shouldAutorotate, enabledInterfaceOrientations и prefeIninterfaceOrientationForPresentation не работает должным образом в iOS 7
У меня возникают проблемы при попытке заблокировать ориентации в некоторых представлениях, но код не является рабочим свойством.
Я использую эти строки в каждом представлении:
- (BOOL)shouldAutorotate
{
return YES;
}
- (NSUInteger)supportedInterfaceOrientations
{
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
return UIInterfaceOrientationMaskPortrait;
} else {
return UIInterfaceOrientationMaskAll;
}
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationPortrait;
}
Это почти работает в представлениях, которые используют UINavigationController, но в тех, которые используют UITabBarController, у меня большие проблемы, потому что кажется, что код не был вызван.