简体   繁体   English

自动旋转专用于某些视图控制器

[英]autorotation exclusive to some view controllers

Ive been searching for an answer for this and cant find one, although I feel like its an easy question. 我一直在寻找答案,但找不到答案,虽然我觉得这是一个简单的问题。

Is it possible to only allow rotation in one view controller? 是否可以仅允许在一个视图控制器中旋转? I'm writing an iphone game and I want to be able to rotate when the user is playing the game but not in the menus. 我正在写一款iphone游戏,我希望能够在用户玩游戏时旋转但不能在菜单中旋转。

thanks for any help you may be able to offer 感谢您提供的任何帮助

put this in your view controller 把它放在你的视图控制器中

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {

return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft );

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM