【问题标题】:autorotation exclusive to some view controllers某些视图控制器独有的自动旋转
【发布时间】:2012-04-02 01:42:31
【问题描述】:

我一直在寻找答案,但找不到答案,尽管我觉得这是一个简单的问题。

是否可以只允许在一个视图控制器中旋转?我正在编写一个 iphone 游戏,并且我希望能够在用户玩游戏但不在菜单中时旋转。

感谢您提供的任何帮助

【问题讨论】:

    标签: iphone objective-c ios view rotation


    【解决方案1】:

    把它放在你的视图控制器中

    -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    
    return (interfaceOrientation == UIInterfaceOrientationLandscapeLeft );
    

    【讨论】:

    • 简单得令人尴尬。谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-11-03
    相关资源
    最近更新 更多