Modal View Controller Won't Start in Landscape Mode

后端 未结 7 1399
死守一世寂寞
死守一世寂寞 2020-12-10 17:10

I have a navigation based app that has a detail view (UIWebView) with action buttons across the bottom in a UIToolbar. I want to add \'notes\' when the \'notes\' button is

相关标签:
7条回答
  • 2020-12-10 18:08

    Got the same issue when presenting modally a navigation controller. Be sure to have correctly implement : shouldAutorotateToInterfaceOrientation

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
    {
        BOOL shouldAutorotate = NO;
        if( isControllerMangingAllOrientations )
        {
            shouldAutorotate = YES;
        }
        else
        {
            shouldAutorotate = (toInterfaceOrientation == UIInterfaceOrientationPortrait);
        }
        return shouldAutorotate;
    }
    

    I was setting the boolean in the viewDidLoad method, not a good idea. Putting it in the initWithNibName:bundle: method is the right place.

    0 讨论(0)
提交回复
热议问题