shouldAutorotateToInterfaceOrientation not working in an universal app
I have written an universal application and i have return开发者_运维问答ed YES in the "shouldAutorotateToInterfaceOrientation" method. The method is getting called but whenever I change the orientation of Iphone or Ipad the view does not rotate. I have even set the autoresizesSubviews
This is mainly due because some other innerview does not allow/set the orientation change. To make things clear, when you rotate the device, the method shouldAutorotateToInterfaceOrientation
will be called for every viewcontroller that hangs on your view tree. If any of them returns NO, the interface won't change.
For example, if you have a tabbarcontroller with viewcontrollers A, B, C and D, the method will be called for all of them, doesn't matter if it is being shown right now.
So be sure that you have changed it in all views.
精彩评论