Lock orientation regardless of rotation

后端 未结 3 1474
广开言路
广开言路 2021-01-27 07:07

I have a UITabBar application with embedded UINavigation for some of the views. On one specific navigationview I am displaying graphs/charts and it wou

3条回答
  •  南方客
    南方客 (楼主)
    2021-01-27 07:23

    Try it in particular ViewController in which you need to required in landscape mode:

    -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    
        return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight );
    
    }
    

提交回复
热议问题