uiwindow

View on top of everything: UIWindow subview VS UIViewController subview

时光怂恿深爱的人放手 提交于 2019-12-18 10:27:37
问题 In order to make a UIView on top of all views like the behavior of UIAlertView , the best way I see is by putting it in the app window, which is by adding the view to: [[[UIApplication sharedApplication] delegate] window] However, the downside I found is that it doesn't automatically take in rotation. In order for it to take in rotation, the best way to do is by adding the view on current AppDelegate window.navigationController / rootViewController , however, by doing this it will no longer

Why is AppDelegate.swift window an optional?

末鹿安然 提交于 2019-12-18 03:31:53
问题 I was reading Apple docs, when I found this sentence: The AppDelegate class contains a single property: window . var window: UIWindow? This property stores a reference to the app’s window. This window represents the root of your app’s view hierarchy. It is where all of your app content is drawn. Note that the window property is an optional, which means it may have no value (be nil) at some point. What I don't understand is: why this property at some point could be nil? What's the case for it

Height and width on iPhone (/iPad)

寵の児 提交于 2019-12-18 01:04:20
问题 This is just a test application, There is only a AppDelegate class to create all I did was create a Window based app, set the supported orientations to only the landscape in the info.plist, and then add the following code: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [application setStatusBarOrientation:UIInterfaceOrientationLandscapeLeft]; // Override point for customization after application launch. UIAlertView *test = [

iOS 8 / 7 UIWindow with UIWindowLevelStatusBar Rotation issue

淺唱寂寞╮ 提交于 2019-12-17 20:55:29
问题 I'm trying to add a UIWindow with UIWindowLevelStatusBar level. it works in portrait mode on ipad perfectly but after rotating device its messed up. on iOS 7.x all rotations are fine except for upside-down, and on iOS 8.x only portrait mode is fine and all other orientations are messed up. any idea how to solve that? CGRect frame = [UIApplication sharedApplication].statusBarFrame; self.statusWindow = [[UIWindow alloc] initWithFrame:CGRectMake(frame.origin.x, frame.origin.y, frame.size.width,

iPhone - UIWindow rotating depending on current orientation?

本秂侑毒 提交于 2019-12-17 17:30:59
问题 I am adding an additional UIWindow to my app. My main window rotates correctly, but this additional window I have added does not rotate. What is the best way to rotate a UIWindow according to the current device orientation? 回答1: You need to roll your own for UIWindow. Listen for UIApplicationDidChangeStatusBarFrameNotification notifications, and then set the the transform when the status bar changes. You can read the current orientation from -[UIApplication statusBarOrientation] , and

How do I toggle between UIWindows?

爷,独闯天下 提交于 2019-12-14 03:06:30
问题 Scenario: I've created an overlay window (with tag = 100) that I eventually want to dismiss. But the following code doesn't work: UIApplication.shared.windows.first?.becomeKey() UIApplication.shared.windows.last?.resignKey() (lldb) po UIApplication.shared.windows ▿ 2 elements - 0 : <UIWindow: 0x7fa698d0ad00; frame = (0 0; 768 1024); gestureRecognizers = <NSArray: 0x600000048550>; layer = <UIWindowLayer: 0x6000000278a0>> - 1 : <UIWindow: 0x7fa698d14bb0; frame = (0 0; 768 1024); autoresize = W

On iOS, can we get to the main UIWindow object from the UIScreen object?

让人想犯罪 __ 提交于 2019-12-13 20:07:35
问题 Say, if we already have aScreen that points to the main screen, by UIScreen *aScreen = [UIScreen mainScreen]; can we get to the main UIWindow object from this UIScreen object? (do they have any connection at all? That is, instead of using [UIApplication sharedApplication].keyWindow ) 回答1: No. The application has a list of windows, usually just one. Each window has a screen property that indicates where it's currently located. The screen object holds information about the physical device. It

Changing UIWindow image (backgroundColor using a UIColor patternImage) with an animation

强颜欢笑 提交于 2019-12-13 08:44:51
问题 I am trying to transition with an animation between two UIWindow images (set using backgroundColor with a UIColor patternImage ). I have two images myImage1 and myImage2 . I change the UIWindow backgroundColor once using the function changeImage1() and then again using the function changeImage2() . I also set the view.backgroundColor = UIColor.clearColor() so that I can see what is happening on the UIWindow . Code below. Test A : When I change window.backgroundColor = UIColor.redColor() to

Facebook Connect login dialog not getting displayed on iphone with new facebook-ios-sdk

旧巷老猫 提交于 2019-12-13 07:04:34
问题 I am using new new Facebook-ios-sdk did everything what is informed in README.mdown. while running this app. It didnt showed me anything. But when i kept break point in show in Fbdialog here: UIWindow* window = [UIApplication sharedApplication].keyWindow; if (!window) { window = [[UIApplication sharedApplication].windows objectAtIndex:0]; } If any one can help me out with this it will be really great. thanks, Aby 回答1: Problem was with the APPID which we also need to provide in the plist. 来源:

How to overlay a view above a keyboard in iOS [duplicate]

佐手、 提交于 2019-12-13 03:24:07
问题 This question already has answers here : How to display UIView over keyboard in iOS (7 answers) Closed last year . I need to present a help screen that overlays an open keyboard - the help screen should dim the whole view underneath and keep just a small hole with full transparency to "highlight" that piece. The point is to provide some information about several view components while highlighting them. Without a keyboard, I could just put a view at top of the hierarchy, but in this case the