iPad app to start in landscape mode

不羁岁月 提交于 2019-12-04 15:33:41

I did some experimenting with an app I'm working on that has the same requirements, and came up with the following:

  1. To set the initial orientations that are supported when the app is first launched, use the "Supported Device Orientations" setting for your target.

    Also back that up with the appropriate shouldAutorotateToInterfaceOrientation code, as you've already done.
  2. For subsequent screens, simply use the shouldAutorotateToInterfaceOrientation code to determine which orientations you want to support. Even if you've specified only landscape modes for the Supported Device Orientation, shouldAutorotateToInterfaceOrientation wins. :)

I think this approach is a little cleaner than using an extra dummy VC.

I achieved a workaround for the Problem and it solved ,

I created a dummy view controller and added as the root view controller of the Window.

Added the below method in the implementation

    -(void)viewDidAppear:(BOOL)animated
    {
        WelcomeScreen *welcomeScreen = [[[WelcomeScreen alloc] initWithNibName:@"WelcomeScreen" bundle:nil] autorelease];
        [self presentModalViewController:welcomeScreen animated:NO];
    }

Now it worked as expected.

bbarnhart

Here is a SO link that will hopefully answer your question on how to launch your app in landscape mode.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!