Reputation: 378
I created a tabbar application. First there were rotation enabled. The app did rotate without any difficulties. But for better usage i commented all auto rotation code and also in the infoplist deleted all other interface except portrait. But now i need it back. I uncommented all code and also added all interface orientation. But the application is not rotating. Please any one help me.Sorry for my bad english
Thanks Rakesh
Upvotes: 0
Views: 691
Reputation: 2899
create a category like this and this method
@implementation UITabBarController(UITabBarControllerCategory)
-(BOOL)shouldAutorotateToInterfaceOrientation:
(UIInterfaceOrientation)toInterfaceOrientation
{
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication]delegate];
if ([AppDelegate isLandScapeOnly]){
return NO;
}
return YES;
}
@end
Upvotes: 0
Reputation: 21805
Every view controller added to tab bar controller will have
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return YES;
}
Make sure you return YES in each of them..
Upvotes: 1