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.
精彩评论