viewDidAppear & viewWillAppear not firing in tabbar app

喜夏-厌秋 提交于 2019-12-25 00:39:21

问题


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

[self.view addSubview:anotherView.view];

Once anotherView is done, I do:

    [self.view removeFromSuperview];

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?


回答1:


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.



来源:https://stackoverflow.com/questions/2308985/viewdidappear-viewwillappear-not-firing-in-tabbar-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!