Disable Rotation of UIViewController in iOS 8

时间秒杀一切 提交于 2019-12-13 18:26:51

问题


I want to disable rotating only one viewController in my Application in iOS 8. I try with some older methods but it is not working or deprecated in iOS 8.

I try this new method of Rotation in iOS 8.

- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator

but i don't know how to disable the rotation in this method. I want only Landscape mode in this viewController. I checked other SO question but my code still not working in iOS 8.

Please Help me.


回答1:


Now this is easier. Try using:

- (BOOL)shouldAutorotate {
    return NO;
}


来源:https://stackoverflow.com/questions/26628338/disable-rotation-of-uiviewcontroller-in-ios-8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!