UiSplitViewController doesn't autorotate

前端 未结 6 2125
小蘑菇
小蘑菇 2020-12-15 13:02

I have recently run into a problem. My iPad app is somehow preventing the iPad from auto-rotating. My app loads a UISplitView with both of the view controllers returning Y

6条回答
  •  自闭症患者
    2020-12-15 13:53

    UISplitViewController is one of the most temperamental view controller subclasses I've ever had to use. In order for it to work "perfectly", it must exist as a single root view in your application's window. You can, however, get around this with some trickery -- in my case, I needed a UITabBarController with at least two distinct UISplitViewControllers as view controllers -- but then you have to take care of weird cases involving rotation and UISplitViewControllerDelegate callbacks not firing.

    Here's hoping that Apple makes UISplitViewController more compatible with other UIKit components in the future...

提交回复
热议问题