开发者

shouldAutorotateToInterfaceOrientation not working in an universal app

开发者 https://www.devze.com 2023-03-16 11:07 出处:网络
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 orientat

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消