简体   繁体   中英

Hide Master View on iPad landscape mode UISplitViewController iOS

I have a FlyoutNavigation component which derives from UISplitViewController, So when I show it in ipad portrait mode, the master view hides by default and I can toggle it properly, but when I change the orientation to landscape the Masterview shows all the time and I cannot even Toggle it.

Is there a way I can hide/unhide it?

尝试设定

splitViewController.preferredDisplayMode = UISplitViewControllerDisplayModePrimaryHidden

Try in appDelegate like this :

guard let splitViewController = window?.rootViewController as? UISplitViewController  
else { fatalError() }

splitViewController.preferredDisplayMode = .primaryHidden

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