KMNavigationBarTransition icon indicating copy to clipboard operation
KMNavigationBarTransition copied to clipboard

Navigation bar flashing on iOS 14

Open toto263 opened this issue 3 years ago • 8 comments

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

toto263 avatar Sep 19 '20 00:09 toto263

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

MoZhouqi avatar Sep 19 '20 21:09 MoZhouqi

@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 avatar Sep 20 '20 02:09 toto263

Yes I can, but it will take some time to make a demo. Do you really need it?

  • Jae

On Sat, Sep 19, 2020 at 2:32 PM Zhouqi Mo [email protected] wrote:

@toto263 https://github.com/toto263 Hi, could you give me a demo to reproduce the problem?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MoZhouqi/KMNavigationBarTransition/issues/158#issuecomment-695358138, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABV5AGXEBSQPTYDH47UTMITSGUPO7ANCNFSM4RSVWGEQ .

toto263 avatar Sep 20 '20 02:09 toto263

@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.

MoZhouqi avatar Sep 20 '20 16:09 MoZhouqi

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 avatar Sep 21 '20 21:09 toto263

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.

toto263 avatar Sep 22 '20 00:09 toto263

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?

MoZhouqi avatar Sep 22 '20 07:09 MoZhouqi

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.

toto263 avatar Sep 22 '20 18:09 toto263