【问题标题】:Popping in a UINavigationController inside a UISplitViewController causes strange transition在 UISplitViewController 中弹出 UINavigationController 会导致奇怪的过渡
【发布时间】:2012-04-01 06:16:29
【问题描述】:

我在UISplitViewController 的主视图中使用UINavigationController。在我的UINavigationController 里面,像往常一样,我有一个UITableViewController。在此表视图中选择一个单元格会将一个新的UINavigationItem 推送到堆栈上。这种转变正如我所料发生的。但是,一旦我按下后退按钮,返回顶部的过渡UINavigationItem 不会像往常一样从左向右滑动。相反,屏幕变黑,持有UINavigationController/UITableViewController 的主视图从顶部在屏幕中心向下滑动,然后 UINavigationController 出现在我期望的左侧。我发现了类似的问题,但所有接受的答案都围绕着没有正确处理轮换。我已经仔细检查了我的所有视图控制器是否针对所有方向返回 YES

【问题讨论】:

  • UITableViewController 中正确实现我在UINavigationViewController 中使用的方向(在iPad 上返回YES)为我解决了这个问题。
  • 我希望可以。从那时起我就再也没有得到回应并继续前进,并且不记得我是如何解决问题的......

标签: ios ipad uinavigationcontroller uisplitviewcontroller


【解决方案1】:

在我的视图控制器中实现以下为我解决了这个问题

-(NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskAll;
}

希望它也适合你

【讨论】:

    【解决方案2】:

    你应该检查你在视图控制器中的 - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation 方法的实现,你已经推入 UINavigationController。

       - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
        {
         // should return YES for all orientations
         // or at least for orientation that your UINavigationController supports.
        }
    

    对我来说,这个问题只出现在 iOS 5 上,但如果你在 iOS 6 上也遇到过,你可以用类似的方式实现-(NSUInteger)supportedInterfaceOrientations

    希望对你有帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-10-01
      • 1970-01-01
      • 2012-11-28
      • 1970-01-01
      相关资源
      最近更新 更多