开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜