iOS 6.0 restrict auto rotation within a navigation controller?

后端 未结 2 1236
南笙
南笙 2021-01-07 04:44

What else should I do?

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation) toInterfaceOrientation
{
    return (toInterfaceOrientation ==          


        
2条回答
  •  旧时难觅i
    2021-01-07 05:18

    You should inherit from UINavigationController and use your custom one everywhere. It's not that much work (just search for occurrences of UINavigationController in your code). This will turn out to be much more flexible cause you'll be able to customize other things if necessary.

    NEVER do it in a category that overrides methods in the main class like that other response suggests.

提交回复
热议问题