iphone - iPad 应用程序中奇怪的 UINavigationController 行为

标签 iphone objective-c ipad xamarin.ios

我有一个以 UISplitViewController 作为根 Controller 的应用程序。 Controller 的主端是标准的 UINavigationController,内部有 UITableController。细节方面只是一个简单的 UIWebView。

执行以下操作后,我可以让 UINavigationController 开始表现出一些奇怪的行为:

  1. 旋转纵向
  2. 通过单击我的 UIBarButtonItem 调出主视图
  3. 通过进入导航树并弹出来在主视图中导航
  4. 旋转为横向
  5. 像以前一样在主视图中导航

当第5步弹出UINavigationController时,动画就全部顶起来了。整个屏幕垂直向下动画,而不是像往常一样 UINavigationController 动画。看起来和UISplitController以及旋转很有关系。

有人听说过这个问题或知道解决方法吗?我不认为我在这里做了任何先进的事情。如果我禁用 UINavigationController 的动画,一切都会照常进行,但我不想这样做,因为正常工作时动画看起来非常流畅。

最佳答案

要解决此问题,您需要在所有 UINavigationController 中实现 ShouldAutoRotateToInterfaceOrientation。

出于某种原因,这只是 iPad 上的问题。编辑:我的案例仅在 iPad 上失败,因此在其他情况下可能并非如此。

关于iphone - iPad 应用程序中奇怪的 UINavigationController 行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4465380/

相关文章:

ios - 从另一个应用程序打开设置应用程序

ios - Pushcontroller 类似于呈现 View Controller 的过渡

ios - Objective-c:在 ios 11 更新后 swrevealcontroller 中的黑色状态栏

ios - 付款队列 :(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions is not called while restoreCompletedTransactions

我的 View Controller 中的 iOS 7 视差效果

iphone - UIImagePNGRepresentation() 和比例(iPhone 4 屏幕)

ios - 查找哪个单元格被单击并执行 Segue

iOS - 导航 Controller 和自定义 View

ios - 关闭模态视图 Controller 中显示的键盘(表单)

iphone - iOS 低内存崩溃,但内存使用率非常低