IPhone - After dismissing Modal View Controller - gap is left at top of page

后端 未结 16 828
暖寄归人
暖寄归人 2020-12-24 07:07

When starting the app, if the user doesn\'t have login information stored, I want to display a modal view controller to force the entry of this information. I found through

16条回答
  •  有刺的猬
    2020-12-24 07:48

    In case anyone looks at this post (I did today and so others might). I am a newbie to objective c but and you may laugh at my suggestion but here goes.

    When running my iPad app the status bar was always overlapping my form. I wasn't happy to use the method for changing the frame coordinate down 20px so went searching.

    Found that if I was to assign my custom view controller to the window rootViewController then the status bar overlap problem went away. I haven't tried the modal stuff in this post but hope this helps other newbies who may be wondering how to sole this problem.

    This is what a simple AppDelegate didFinishLaunchingWithOptions method would look like:

    (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
        self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
        // Override point for customization after application launch.
    
        TEGGameViewController *gameVC = [[TEGGameViewController alloc] init];
    
        self.window.rootViewController = gameVC;
    
        [self.window makeKeyAndVisible];
        return YES;
    }
    

提交回复
热议问题