Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

存在-viewWillAppear:无法调用的Bug #9

Open
Loonytone opened this issue Nov 23, 2017 · 0 comments
Open

存在-viewWillAppear:无法调用的Bug #9

Loonytone opened this issue Nov 23, 2017 · 0 comments

Comments

@Loonytone
Copy link

我查了一下,得到的答案如下,但是我现在不能修复它:
产生原因是:将UINavigationController的view作为subview添加到了其他viewController的view中。
项目中有一句:_sponsor.navigationController.view addSubview:self.navigationController.view,说的大概就是这个意思吧。

解决办法:把导航控制器上层controller设为UINavigationController的delegate,在
-(void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated ;中显示调用viewWillAppear。

-(void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
{
[viewController viewWillAppear:animated];
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant