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

cw_pushViewController 不能显示下一个控制器导航栏 #126

Open
weizhangCoder opened this issue May 14, 2020 · 3 comments
Open

cw_pushViewController 不能显示下一个控制器导航栏 #126

weizhangCoder opened this issue May 14, 2020 · 3 comments

Comments

@weizhangCoder
Copy link

1 用的最新的版本 主控制器 MainViewController 的导航栏隐藏 。NextViewController控制器的导航栏显示,都是通过- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated 这个方法去判断导航栏是否隐藏。但是点击cw_pushViewController 这个方法到下一个控制器的时候,不会走控制导航栏影藏和显示的方法。

看了下cw_pushViewController内部的代码获取的UINavigationController应该是LeftViewController这个控制器的。我需要获取的是MainViewController 的nav.
目前的临时的解决办法是 。判作者解决下

[self dismissViewControllerAnimated:YES completion:^{
UINavigationController *nav = [UIApplication sharedApplication].visibleNavigationController;
[nav pushViewController:vc animated:YES];
}];

@OceanAndWu
Copy link

我也遇到和你一样的问题了 有什么解决办法吗

@weizhangCoder
Copy link
Author

我也遇到和你一样的问题了 有什么解决办法吗

目前我临时的解决把办法就是,上面写的。dismiss 结束后,再获取当前的navigation ,然后再push.

@OceanAndWu
Copy link

我测试了一下,dismiss结束以后会有个跳到主页的过程,再Push你想要的界面。

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

2 participants