viewDidAppear& viewWillAppear未在标签栏应用中触发 [英] viewDidAppear & viewWillAppear not firing in tabbar app

查看:66
本文介绍了viewDidAppear& viewWillAppear未在标签栏应用中触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在标签栏应用程序中,我通过执行以下操作将视图添加到我的第一个标签栏视图:

In a tab bar application, I'm adding a view to my first tabbar view by doing:

[self.view addSubview:anotherView.view];

完成anotherView后,我会这样做:

Once anotherView is done, I do:

    [self.view removeFromSuperview];

哪个返回父级,但不会在父级上触发viewDidAppear或viewWillAppear。我可以使用消息传递,但似乎必须有更好的方法。有任何建议吗?

Which goes back to the parent but doesn't fire viewDidAppear or viewWillAppear on the parent. I can use messaging but it seems there must be a better way. Any suggestions?

推荐答案

将子视图添加到第一个视图时,它仍然可见,就在第二个视图的后面。这些方法不会触发,因为即使在第二个视图中完全覆盖了从技术上来说它始终可见。

When you add a subview to the first view, it's still visible, just behind the second view. Those methods don't fire because technically it's visible the whole time, even if it's completely covered by the second view.

这篇关于viewDidAppear& viewWillAppear未在标签栏应用中触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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