【问题标题】:UINavigationController, wrong back animation orientationUINavigationController,错误的返回动画方向
【发布时间】:2011-06-09 14:43:18
【问题描述】:

我有一个非常奇怪的问题,快把我逼疯了!

我的应用只有一个方向:纵向。通过按下按钮,您可以以模态方式打开UINavigationController(通过调用方法presentModalViewController...)。这个UINavigationController 可以定向(shouldAutorotate 总是返回YES)。

除了一件事之外,这很好用!过渡:它始终是纵向的。我不明白为什么。我尝试将状态栏的方向设置为与UINavigationController's 方向匹配,但它不起作用。我很疑惑……

谁能帮帮我?

谢谢!

【问题讨论】:

    标签: iphone uinavigationcontroller navigation orientation transition


    【解决方案1】:

    在您呈现模式的视图控制器的 .m 上使用此代码

    -(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation{
    
        if((toInterfaceOrientation == UIInterfaceOrientationPortrait) ||(toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown))
            return NO;
    
        return YES;
    }
    

    【讨论】:

      猜你喜欢
      • 2011-03-20
      • 2011-10-03
      • 2012-11-02
      • 2016-04-22
      • 2014-04-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多