不能旋转8
问题描述:
我想禁用我的应用程序在iOS的8 我试图用老方法仅旋转一个的viewController,但它不工作或iOS的弃用8不能旋转8
我试试这个在iOS 8中旋转的新方法。
- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
但我不知道如何禁用此方法中的旋转。我只想在这个viewController中使用横向模式。我查了其他SO问题,但我的代码仍然不能在iOS 8中工作。
请帮帮我。
答
现在这很容易。尝试使用:
- (BOOL)shouldAutorotate {
return NO;
}
这对我不起作用。 – maxhs 2015-04-16 04:54:51
试一下: - (BOOL)shouldAutorotate {YES; YES; YES; (NSUInteger)supportedInterfaceOrientations { }返回UIInterfaceOrientationMaskPortrait; } – 2015-04-24 07:09:58
伊娃的答案适合我。 但更改为 - (UIInterfaceOrientationMask)supportedInterfaceOrientations 以终止警告消息。 – willSapgreen 2016-01-06 04:50:57