Force controllers to Change their orientation in Either Portrait or Landscape

前端 未结 2 444
执念已碎
执念已碎 2020-12-06 23:03

I have following Controllers, (I have selected all types orientation modes in iPad)

Here is my iPad Storyboard layout

Custom NavigationController >         


        
2条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-06 23:45

    - (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);//choose portrait or landscape
    }
    - (BOOL) shouldAutorotate{
    return NO;
    }
    - (NSUInteger) supportedInterfaceOrientations{
    return UIInterfaceOrientationMaskPortrait;//choose portrait or landscape, same as above
    }
    

提交回复
热议问题