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

navigationController?.navigationBar.shadowImage 设置异常失效 #162

Open
yuanyedehuhuan opened this issue May 13, 2021 · 2 comments
Open

Comments

@yuanyedehuhuan
Copy link

在demo中测试,第一个页面(Title 1)在 viewDidLoad 中设置为 navigationController?.navigationBar.shadowImage = UIImage(),即隐藏导航栏横线。第二个页面(Title 2)在 viewDidLoad 中设置为 navigationController?.navigationBar.shadowImage = nil,即显示导航栏横线。

设置完毕,点击从 Title 1 跳转到 Title 2,会出现横线显示异常,push过程中横线是显示的,当跳转完成时横线消失,之后无论怎么设置都不好使了。

经过测试,发现需要保证第一个页面显示横线,或者至少保证在 viewDidAppear 之前显示横线,如果需要第一个页面隐藏横线,就在 viewDidAppear 中设置 navigationController?.navigationBar.shadowImage = UIImage()。只有这样后续操作才能正常。

@zedxpp
Copy link

zedxpp commented Oct 7, 2021

我也碰到这个问题了, 我是需要都隐藏, 但是设置[self.navigationController.navigationBar setShadowImage:[UIImage new]];和 navigationBarAppearance.shadowColor = [UIColor clearColor];
navigationBarAppearance.shadowImage = [UIImage new];都不行

@zealforbeing
Copy link

zealforbeing commented Oct 12, 2021

遇到一样的问题,尝试在 [UIViewController (KMNavigationBarTransition) km_addTransitionNavigationBarIfNeeded] 里强制设置,倒是有用

bar.standardAppearance.shadowImage = [UIImage new];
bar.standardAppearance.shadowColor = [UIColor clearColor];
bar.scrollEdgeAppearance.shadowImage = [UIImage new];
bar.scrollEdgeAppearance.shadowColor = [UIColor clearColor];

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

3 participants