I've a problem with mergReader function.
In my iOS app I use a mobilePick function,
before I call mergReader the viewing of mobilPick is well in center of the screen
but after mergReader called the next use of mobilPick put to left position the Picker into the screen.
after calling mergReader screenshot:
After
before calling mergReader screenshot:
Before
Any hints?
Thanks,
Paolo
Related
Beginner question:
I am working on a macOS App with current Xcode 8.3.3 and Swift3. I am using MASShortcut to open a window by a shortcut that has been hidden by startup.
I use the following code on the shortcut event:
NSApplication.shared().windows.last!.makeKeyAndOrderFront(nil)
NSApplication.shared().activate(ignoringOtherApps: true)
For multiple monitor setups (I have two external displays attached to my MacBook), I want to specify the screen where the window pops up. I know there is NSScreen.screens() that gives back all available screens. But how do I use it for letting my window pop up on screen 1/2/3?
Thanks a lot!
Edit: Solved with the answer of #michael-doltermann:
I can iterate over NSScreen.screens() and access for example the midX/midY coords to create a NSPoint instance to replace my window.
var pos = NSPoint()
pos.x = NSScreen.screens()![myIndex].visibleFrame.midX)
pos.y = NSScreen.screens()![myIndex].visibleFrame.midY)
self.window?.setFrameOrigin(pos)
Each screen from NSScreen.screens() has a visibleFrame property that tells you the global frame rectangle.
You can then set your window origin to fit inside the frame rect coordinates of whatever screen you want. Objective-C answers can be seen here and here.
This does mean you have to write some code to specify the preferred window. In my own app, I take the global frame rectangles for each screen and then scale them way down into a NSView to display something that looks like the Monitors pane from System Preferences:
I use privacy-screen plugin to hide content when app is in the background, but it shows just gray background. I need to set splashScreen instead. Any suggestions?
I tried splashScreen plugin, but it is not working for me.
I don't know if it's the best way but I think that using Capacitor appStateChange from #capacitor/app (documentation) you could show and hide a screen with your logo when app is in background or foreground.
import { App } from '#capacitor/app';
App.addListener('appStateChange', ({ isActive }) => {
console.log('App state changed. Is active?', isActive);
if(!isActive) showLogoScreen();
else hideLogoScreen();
});
I hope it helps :)
For iOS, I did it simply in native code: just find the "applicationWillResignActive" method in AppDelegate and insert a view on top of the window.
For Android, sadly I couldn't find a better solution. The "gray background" you described is likely the implementation of Hide screen in 'Recent Apps List', but allow screenshots
I have WebView inside the LazyColumn. It shows up fine. The thing is when I try to navigate back by calling navController.popBackStack(), I got fatal crash (Fatal signal 11 (SIGSEGV)).
I ran it on the emulator. It works fine when click the "Back" button in the emulator.
Also, it works fine when I replace LazyColumn with Column.
Any idea or thought?
I had the same issue and you can fix this in some ways that I've found:
destroying your WebViev webView.destroy() or making it invisible webView.visibility = View.INVISIBLE when your screen disappears.
adding alpha = 0.99F (any value but less than 1) to WebView. webView.alpha = 0.99F
When using WebView inside LazyColumn try using the remember function to retain the state across rebuilds. Alternatively, you can try a different layout component like VerticalScroller to wrap the WebView.
LazyColumn{
items(items){
// ...
remember {
WebView(/* ... */)
}
}
}
I would like to get the screen containing the dock and the menubar.
Is there a way to do this?
I've check Apple documentation about NSScreen but couldn't find any information about that.
Thanks!
Actually, the answer was, as #Willeke suggested, in the documentation of NSScreen.screens (see:
https://developer.apple.com/documentation/appkit/nsscreen/1388393-screens).
The screen considered as main (with the menubar) is the one with index 0.
It is not the same as NSScreen.main which is the screen with the current active window.
I have an issue with iScroll4 when I change the orienatation from portrait to landscape. It is working on AppMobi XDK, but on iPhone, it is not rendering properly. I have tried to trap the orientationchange event and called the refresh method of iScroll with different timeout values, but no luck.
please use jq.scroller.js from the link:
https://github.com/appMobi/jQ.Mobi/tree/master/plugins
It is easy to use with like this:
var options={
verticalScroll:true, //vertical scrolling
horizontalScroll:false, //horizontal scrolling
scrollBars:true //display scrollbars
vScrollCSS : "scrollBarV", //CSS class for veritcal scrollbar
hScrollCSS : "scrollBarH", //CSS class for horizontal scrollbar
refresh:true, //Adds 'Pull to refresh' at the top
refreshFunction:updateMessage //callback function to execute on pull to refresh
}
var scroller = $("#my_div").scroller(options);
Replace #my_div with your Div ID.It will work perfectly.
Thanks
This is a bug with iScroll. I'm a developer at appMobi, and lead developer of jqMobi and our scrolling library does not have this problem.