How do I force a specific UIInterfaceOrientation on an individual view in a UINavigationController?

后端 未结 8 886
闹比i
闹比i 2020-12-14 17:27

Okay, so here\'s the situation:

I have an app in which I only want ONE specific view in a UINavigationController to have a landscape orientation. This view is a UIIm

8条回答
  •  一整个雨季
    2020-12-14 18:22

    To use a View in only landscape, I have the following in the ViewController:

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

提交回复
热议问题