presentModalViewController什么都不做 [英] presentModalViewController does nothing

查看:85
本文介绍了presentModalViewController什么都不做的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个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什么都不做的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆