代码之家  ›  专栏  ›  技术社区  ›  Knodel

仅支持纵向

  •  1
  • Knodel  · 技术社区  · 15 年前

    我只需要在我的应用程序中支持纵向。我该怎么做?我已经尝试添加

    <key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
    </array>
    

     -(BOOL)     shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return UIInterfaceOrientationPortrait;
    }
    

    但它没有帮助-视图还是会旋转。

    事先谢谢!

    4 回复  |  直到 12 年前
        1
  •  4
  •   tobiasbayer    15 年前

    -(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation NO

        2
  •  2
  •   JBRWilkinson    15 年前

     -(BOOL)     shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
    {
        return interfaceOrientation == UIInterfaceOrientationPortrait 
               || interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown ;
    }
    
        3
  •  1
  •   John Sibly    12 年前

        4
  •  0
  •   karim    13 年前

    -(BOOL)shouldAutorotate {
        return NO;
    }