我已经实现了正确的功能,但它们不会被触发?我在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