简体   繁体   中英

How to show master view in UiSplitviewcontroller in iPad

When we open the application very first time in portrait or landscape view it shows the master view in splitviewcontroller,But when we rotate the screen from landscape to portrait it hides the master view and from portrait to landscape it shows the master view and vice versa.

Can anyone help me to tell that i want to show the master view in both the orientation.

The split view controller automatically decides the most appropriate display mode based on the device and the current app size. You can assign this constant as the value of the preferredDisplayMode property but this value is never reported by the displayMode property.

Available in iOS 8.0 and later.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
   // Override point for customization after application launch.
    UISplitViewController *splitViewController = (UISplitViewController*)self.window.rootViewController;
    splitViewController.preferredDisplayMode = UISplitViewControllerDisplayModePrimaryOverlay;
   return YES;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM