How can I display one UIView in landscape?

后端 未结 4 660
眼角桃花
眼角桃花 2020-12-13 11:08

I\'ve looked at every question so far and none seem to actually answer this question.

I created a UITabBarController and added several view controllers to it. Most

4条回答
  •  囚心锁ツ
    2020-12-13 11:45

    Override the Orientation method in your controller class and force it to Landscape like this :

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
    {
        // Overriden to allow any orientation.
        return UIInterfaceOrientationIsLandscape(interfaceOrientation);
    }
    

    Simple and efficient !

提交回复
热议问题