开发者

How to change already developed app into both orientations Landscape and portrait?

开发者 https://www.devze.com 2023-03-18 04:11 出处:网络
I deve开发者_JAVA技巧loped app(navigation + tabbar) in portrait mode. But now I want that if user change its orientation to landscape or

I deve开发者_JAVA技巧loped app(navigation + tabbar) in portrait mode.

But now I want that if user change its orientation to landscape or portrait then all should be rotate in that orientation.


You need to set each view's control autoresizingmask. You can do it through xib as well as code as per your need and add below method in all viewControllers and it should work.

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Overriden to allow any orientation.
    return YES;
}

Hope this help.


And have a look into your ".plist", you can define "Supported interface orientations" (UISupportedInterfaceOrientations) here.

0

精彩评论

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

关注公众号