问题描述
我有一个UIViewController( parent )在<$ c上用另一个UIViewController( child )调用 presentModalViewController
$ c> viewDidLoad 。
I have a UIViewController (parent) that calls presentModalViewController
with another UIViewController (child) on viewDidLoad
.
如果 parent 没有UINavigationController,那么 presentModalViewController
什么都不做。如果它有一个UINavigationController,则 presentModalViewController
按预期显示 child 。
If parent doesn't have a UINavigationController, then presentModalViewController
does nothing. If it has a UINavigationController, then presentModalViewController
shows child as expected.
这是 presentModalViewController的标准行为
或者还有其他什么在玩吗?
Is this the standard behavior of presentModalViewController
or is there something else at play here?
推荐答案
因为您要在 viewDidLoad 中展示它,请尝试在 viewDidAppear 中展示它。
It is because you are presenting it in viewDidLoad, try presenting it in viewDidAppear.
这篇关于presentModalViewController什么都不做的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!