问题
I have trouble with the UISplitView on iPad.
I create normal application using UISplitView and in DetailViewController I add
override func viewDidLoad() {
super.viewDidLoad()
navigationItem.leftBarButtonItem = splitViewController?.displayModeButtonItem
navigationItem.leftItemsSupplementBackButton = true
}
in iPhone it work fine
But in iPad it doesn't show button for stretching the detail view controller.
I know it can be done, because Apple has it in Note application.
How to accomplish this the right way?
回答1:
Set the SplitViewController's preferredDisplayMode to UISplitViewControllerDisplayModeAllVisible and it will appear.
But this will change it in portrait mode too on the iPad, and you probably don't want it there, so you'll have to check when rotating and change it accordingly.
来源:https://stackoverflow.com/questions/43627214/uisplitviewcontroller-displaymodebuttonitem-in-ipad