开发者

How do I call shouldAutorotateToInterfaceOrientation method?

开发者 https://www.devze.com 2023-02-08 14:36 出处:网络
i developing an iPad app in which i working with images.The application is worked fine in portrait mode when application launched in portrait mode but it gives me ridiculous problem with frames when a

i developing an iPad app in which i working with images.The application is worked fine in portrait mode when application launched in portrait mode but it gives me ridiculous problem with frames when app i launched in landscape mode. My all functionality already written in "shouldAutorotateToIn开发者_JAVA百科terfaceOrientation" this method. If i able call this method then it will remove all problem of frames.How i call shouldAutorotateToInterfaceOrientation method in my application in any function?


You don't call shouldAutorotateToInterfaceOrientation: yourself. UIKit sends this message to your view controller in order to know if the view controller should be rotated or not. Move your layout code from shouldAutorotateToInterfaceOrientation: to willRotateToInterfaceOrientation: and it should work.


Check out the UIViewController Class Reference.

shouldAutorotateToInterfaceOrientation:

Your implementation of this method should simply return YES or NO based on the value in the interfaceOrientation parameter. Do not attempt to get the value of the interfaceOrientation property or check the orientation value reported by the UIDevice class. Your view controller is either capable of supporting a given orientation or it is not.

0

精彩评论

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