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

Navigation bar flashing on iOS 14 #158

Open
toto263 opened this issue Sep 19, 2020 · 8 comments
Open

Navigation bar flashing on iOS 14 #158

toto263 opened this issue Sep 19, 2020 · 8 comments

Comments

@toto263
Copy link

toto263 commented Sep 19, 2020

When the screen is changed, navigation bar color is flashing on iOS 14.
I applied latest iOS 14 patch, and it is better, but still flashing.

before iOS 14 patch:
https://youtu.be/iv23TxJsXmU

after iOS 14 patch:
https://youtu.be/Y-zH8mqzWf0

@MoZhouqi
Copy link
Owner

@toto263 Hi, there are three patch versions, are any of them working properly?

@toto263
Copy link
Author

toto263 commented Sep 20, 2020

@toto263 Hi, there are three patch versions, are any of them working properly?

I applied the patch on KMNavigationBarTransition/UIViewController+KMNavigationBarTransition.m only.

if (@available(iOS 14, *)) {
    bar.items = @[[UINavigationItem new]]; // fix Apple's bug in iOS 14
}

Is there any other patches?

@toto263
Copy link
Author

toto263 commented Sep 20, 2020 via email

@MoZhouqi
Copy link
Owner

@toto263 Hi, there are three patch versions, are any of them working properly?

I applied the patch on KMNavigationBarTransition/UIViewController+KMNavigationBarTransition.m only.

if (@available(iOS 14, *)) {
    bar.items = @[[UINavigationItem new]]; // fix Apple's bug in iOS 14
}

Is there any other patches?

The release 1.16, 1.1.7 and 1.1.8 are three patches respectively.

@toto263
Copy link
Author

toto263 commented Sep 21, 2020

I tried three patches (1.1.6, 1.1.7, 1.1.8), and they work almost same. I can't find any differences between them. Now I am using 1.1.8.

@toto263
Copy link
Author

toto263 commented Sep 22, 2020

I could solve my issue by adding the following lines at km_addTransitionNavigationBarIfNeeded of UIViewController+KMNavigationBarTransition.m

- (void)km_addTransitionNavigationBarIfNeeded {
...
    bar.barStyle = self.navigationController.navigationBar.barStyle;
    bar.tintColor = self.navigationController.navigationBar.tintColor;
    bar.translucent = self.navigationController.navigationBar.translucent;
    if (@available(iOS 13.0, *)) {
        bar.standardAppearance = self.navigationController.navigationBar.standardAppearance;
	bar.scrollEdgeAppearance = self.navigationController.navigationBar.scrollEdgeAppearance;
    }
...
}

I am not sure if I need to add the same code elsewhere such as km_viewDidAppear, km_popViewControllerAnimated, km_popToViewController, km_popToRootViewControllerAnimated.

@MoZhouqi
Copy link
Owner

I could solve my issue by adding the following lines at km_addTransitionNavigationBarIfNeeded of UIViewController+KMNavigationBarTransition.m

- (void)km_addTransitionNavigationBarIfNeeded {
...
    bar.barStyle = self.navigationController.navigationBar.barStyle;
    bar.tintColor = self.navigationController.navigationBar.tintColor;
    bar.translucent = self.navigationController.navigationBar.translucent;
    if (@available(iOS 13.0, *)) {
        bar.standardAppearance = self.navigationController.navigationBar.standardAppearance;
	bar.scrollEdgeAppearance = self.navigationController.navigationBar.scrollEdgeAppearance;
    }
...
}

I am not sure if I need to add the same code elsewhere such as km_viewDidAppear, km_popViewControllerAnimated, km_popToViewController, km_popToRootViewControllerAnimated.

So can this problem be reproduced on iOS 13?

@toto263
Copy link
Author

toto263 commented Sep 22, 2020

I could solve my issue by adding the following lines at km_addTransitionNavigationBarIfNeeded of UIViewController+KMNavigationBarTransition.m

- (void)km_addTransitionNavigationBarIfNeeded {
...
    bar.barStyle = self.navigationController.navigationBar.barStyle;
    bar.tintColor = self.navigationController.navigationBar.tintColor;
    bar.translucent = self.navigationController.navigationBar.translucent;
    if (@available(iOS 13.0, *)) {
        bar.standardAppearance = self.navigationController.navigationBar.standardAppearance;
	bar.scrollEdgeAppearance = self.navigationController.navigationBar.scrollEdgeAppearance;
    }
...
}

I am not sure if I need to add the same code elsewhere such as km_viewDidAppear, km_popViewControllerAnimated, km_popToViewController, km_popToRootViewControllerAnimated.

So can this problem be reproduced on iOS 13?

I had no problem with iOS 13. It happened after iOS 14 update.

biostome added a commit to biostome/KMNavigationBarTransition that referenced this issue Mar 18, 2024
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