Force portrait mode

前端 未结 2 1400
无人共我
无人共我 2021-01-26 03:29

Alright, since no one answered my previous question, I have come to believe that there may be no easy way to do this. But I am optimistic. Here\'s my issue:

In my app, I

2条回答
  •  灰色年华
    2021-01-26 04:00

    Based on my understanding of the question I assume that you want the 2nd view controller to be portrait and the first view controller to be landscape.

    For the second viewcontroller, add this method:

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    {
        return (interfaceOrientation == UIInterfaceOrientationPortrait);
    
    }
    

    For the first view controller:

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    {
        return (interfaceOrientation == UIInterfaceOrientationLandscape);
    
    }
    

提交回复
热议问题