我已經實現了正確的功能,但它們不會被觸發?我在StackOverFlow上嘗試了幾個解決方案,但都沒有工作。我已經嘗試將視圖添加到UINavigationController,也不起作用。強制UIViewController處於橫向模式iOS7
FakeIDDetailViewController.h:
@interface FakeIDDetailViewController : UIViewController
@end
FakeIDDetailViewController.m:
@interface FakeIDDetailViewController()
-(BOOL)shouldAutorotate
{
return NO;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (UIInterfaceOrientationMaskLandscapeLeft);
}
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskLandscapeLeft;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationLandscapeLeft;
}
- (NSUInteger) application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
return UIInterfaceOrientationLandscapeLeft;
}
您嘗試過哪些SO解決方案?正如你所說,有幾個...我寧願不通過它們全部列出。 – nhgrif
可能的重複:http://stackoverflow.com/questions/19095161/force-landscape-ios-7 –
可能的重複[在iOS6中,麻煩強制ViewController某些interfaceOrientation推入堆棧時](http:// stackoverflow。 com/questions/15300819/in-ios6-trouble-forcing-viewcontroller-to-certain-interfaceorientation-when-pus) – matt