From 0c6e2f00b1ee8122499df08f060d5f016868355e Mon Sep 17 00:00:00 2001 From: yogevbd Date: Sun, 1 Dec 2019 18:56:28 +0200 Subject: [PATCH] Fix topBar background color animation on iOS 13 --- lib/ios/UINavigationBar+utils.h | 2 -- lib/ios/UINavigationBar+utils.m | 10 ++++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/ios/UINavigationBar+utils.h b/lib/ios/UINavigationBar+utils.h index f24d554c73f..fb97f0549e3 100644 --- a/lib/ios/UINavigationBar+utils.h +++ b/lib/ios/UINavigationBar+utils.h @@ -4,8 +4,6 @@ - (void)rnn_setBackgroundColor:(UIColor *)color; -- (void)rnn_setBackgroundColorTransparent; - - (void)rnn_setBackIndicatorImage:(UIImage *)image; - (void)rnn_showBorder:(BOOL)showBorder; diff --git a/lib/ios/UINavigationBar+utils.m b/lib/ios/UINavigationBar+utils.m index acb83af6fa7..174aa6ff7bd 100644 --- a/lib/ios/UINavigationBar+utils.m +++ b/lib/ios/UINavigationBar+utils.m @@ -29,7 +29,6 @@ - (void)rnn_setBackgroundColor:(UIColor *)color { - (void)setBackgroundColor:(UIColor *)color { if (@available(iOS 13.0, *)) { - [self configureWithDefaultBackground]; [self getNavigaitonBarStandardAppearance].backgroundColor = color; [self getNavigaitonBarCompactAppearance].backgroundColor = color; [self getNavigaitonBarScrollEdgeAppearance].backgroundColor = color; @@ -41,7 +40,14 @@ - (void)setBackgroundColor:(UIColor *)color { - (void)setBackgroundColorTransparent { if (@available(iOS 13.0, *)) { - [self configureWithTransparentBackground]; + UIColor* clearColor = [UIColor clearColor]; + [self getNavigaitonBarStandardAppearance].backgroundColor = clearColor; + [self getNavigaitonBarCompactAppearance].backgroundColor = clearColor; + [self getNavigaitonBarScrollEdgeAppearance].backgroundColor = clearColor; + [self getNavigaitonBarStandardAppearance].backgroundEffect = nil; + [self getNavigaitonBarCompactAppearance].backgroundEffect = nil; + [self getNavigaitonBarScrollEdgeAppearance].backgroundEffect = nil; + } else { if (![self viewWithTag:TOP_BAR_TRANSPARENT_TAG]){ UIView *transparentView = [[UIView alloc] initWithFrame:CGRectZero];