iOS 6 UIInterfacePortrait ONLY viewcontroller being presented & stuck in landscape… when coming back from a landscape viewcontroller in nav stack

前端 未结 2 1761
醉梦人生
醉梦人生 2021-02-06 12:56

So like many others, I ran into the problem of only having one or two viewcontrollers support both portrait and landscape interface orientations, in an otherwise portrait only a

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-06 13:13

    In vcA set

    -(BOOL)shouldAutorotate
    {
      return YES;
    }
    

    But keep

    -(NSUInteger)supportedInterfaceOrientations
    {
      return UIInterfaceOrientationPortrait;
    }
    

    Then the view will rotate back to the (only) supported orientation when you return from vcB

提交回复
热议问题