objective-c - 使用-presentModalViewController :animated: with UITabBarController NOT animated

标签 objective-c ios

因此,此应用程序的 rootViewControllerUITabBarController 子类。我们遇到了一个奇怪的问题,如果我们将 NO 传递给动画,我们就无法将 UITabBarController 获取到 -presentModalViewController:animated: 。我们尝试了多种方法:-viewDidLoad-viewWillAppear-viewDidAppear,并且只有在之后执行才能使其正常工作延迟,这很糟糕。

我决定将其分解为一个测试,发现如果我有一个在 -viewDidAppear 中调用 -presentModalViewController:animated:UIViewController code> 方法,它与 animated 参数的 YESNO 一起按预期工作。但是,如果此 VC 是 UITabBarController,则当 animatedYES 时,它可以工作,但如果为 NO,则不起作用。

有什么想法吗?这是一个错误吗?我在网上和文档中进行了搜索,但找不到 UITabBarController 不能以这种方式呈现 View 的原因。

最佳答案

这听起来确实像是一个错误。我建议您提交 bugreport与苹果。如果它阻止了你的项目,你可以通过 Apple 的一个支持事件提交它,如果他们发现这确实是一个错误,他们将退还该支持事件的费用(这样你就不会失去任何东西)。如果不是错误,他们将为您提供解决方案。

关于objective-c - 使用-presentModalViewController :animated: with UITabBarController NOT animated,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6601113/

相关文章:

objective-c - 如何从 cocoa 中的另一个文件设置对象的属性?

ios - 使用视差滚动实现 Twitter 配置文件之类的 View

ios - GRMustache 在过滤器中传递常量值?

ios - 除自动布局之外的任何其他调整 View 大小的方法

objective-c - Objective C 类到 NSDictionary

iOS 多点触控不起作用

ios - 为什么在我没有购买任何应用程序内购买时购买会恢复?

ios - 如何从 Swift 3 中的数据中提取 Int16

ios - 这是一个好的编程习惯吗? if 条件是返回带有回调的 bool 的方法

ios - 如何将图像从NSDictionary获取到UICollectionView iOS?