iOS 6 auto rotate confusion

前端 未结 6 763
萌比男神i
萌比男神i 2020-12-29 17:08

I have my entire interface in one Storyboard. How can I make most of the ViewControllers only support a portrait orientation while only a couple supporting all orientations.

6条回答
  •  旧时难觅i
    2020-12-29 17:34

    In your Navigation Controller subclass, forward the decision to the top view controller in the stack:

    -(NSUInteger) supportedInterfaceOrientations {
       return [self.topViewController supportedInterfaceOrientations];
    }
    

    Creating a separate storyboard file for this is the worst path to follow, it'll be a maintenance nightmare to keep them in sync with your app updates.

提交回复
热议问题