iOS 6 - (BOOL)shouldAutorotate not getting called for navigation controllers pushed viewControllers

后端 未结 5 795
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-09 07:31

For my app rootViewController is navgationController.

I found that pushed controller\'s

-(BOOL)shouldAutorotate is not

5条回答
  •  一生所求
    2021-02-09 08:25

    You can check for the interface orientation via

    [UIApplication sharedApplication].statusBarOrientation
    

    when the view controller is loaded, say, in viewWillAppear. There you can do your layout of subviews. Once the view is up, shouldAutorotate will be called whenever the device is turned.

提交回复
热议问题