From d2ed290b5824f4320965d212095f7e344c3a5bc3 Mon Sep 17 00:00:00 2001 From: Yogev Ben David Date: Thu, 5 Dec 2019 16:42:40 +0200 Subject: [PATCH] Fix black topBar background color (#5726) * Fix black topBar background color --- lib/ios/RNNStackPresenter.m | 6 +++--- lib/ios/UINavigationBar+utils.m | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/ios/RNNStackPresenter.m b/lib/ios/RNNStackPresenter.m index d3e595de69c..5613b747461 100644 --- a/lib/ios/RNNStackPresenter.m +++ b/lib/ios/RNNStackPresenter.m @@ -29,15 +29,15 @@ - (void)applyOptions:(RNNNavigationOptions *)options { self.interactivePopGestureDelegate.originalDelegate = stack.interactivePopGestureRecognizer.delegate; stack.interactivePopGestureRecognizer.delegate = self.interactivePopGestureDelegate; + [stack setBarStyle:[RCTConvert UIBarStyle:[withDefault.topBar.barStyle getWithDefaultValue:@"default"]]]; + [stack setNavigationBarTranslucent:[withDefault.topBar.background.translucent getWithDefaultValue:NO]]; + [stack setNavigationBarNoBorder:[withDefault.topBar.noBorder getWithDefaultValue:NO]]; [stack setTopBarBackgroundColor:[withDefault.topBar.background.color getWithDefaultValue:nil]]; [stack setInteractivePopGestureEnabled:[withDefault.popGesture getWithDefaultValue:YES]]; [stack setRootBackgroundImage:[withDefault.rootBackgroundImage getWithDefaultValue:nil]]; [stack setNavigationBarTestId:[withDefault.topBar.testID getWithDefaultValue:nil]]; [stack setNavigationBarVisible:[withDefault.topBar.visible getWithDefaultValue:YES] animated:[withDefault.topBar.animate getWithDefaultValue:YES]]; [stack hideBarsOnScroll:[withDefault.topBar.hideOnScroll getWithDefaultValue:NO]]; - [stack setNavigationBarNoBorder:[withDefault.topBar.noBorder getWithDefaultValue:NO]]; - [stack setBarStyle:[RCTConvert UIBarStyle:[withDefault.topBar.barStyle getWithDefaultValue:@"default"]]]; - [stack setNavigationBarTranslucent:[withDefault.topBar.background.translucent getWithDefaultValue:NO]]; [stack setNavigationBarClipsToBounds:[withDefault.topBar.background.clipToBounds getWithDefaultValue:NO]]; [stack setNavigationBarBlur:[withDefault.topBar.background.blur getWithDefaultValue:NO]]; [stack setNavigationBarLargeTitleVisible:[withDefault.topBar.largeTitle.visible getWithDefaultValue:NO]]; diff --git a/lib/ios/UINavigationBar+utils.m b/lib/ios/UINavigationBar+utils.m index 707aa75e681..c40a9e535b8 100644 --- a/lib/ios/UINavigationBar+utils.m +++ b/lib/ios/UINavigationBar+utils.m @@ -1,7 +1,6 @@ #import "UINavigationBar+utils.h" #import "RNNFontAttributesCreator.h" - @implementation UINavigationBar (utils) - (void)rnn_setBackIndicatorImage:(UIImage *)image { @@ -70,7 +69,6 @@ - (void)setBackgroundColor:(UIColor *)color { [self getNavigaitonBarCompactAppearance].backgroundColor = color; [self getNavigaitonBarScrollEdgeAppearance].backgroundColor = color; } else { - [super setBackgroundColor:color]; self.barTintColor = color; } } @@ -86,7 +84,7 @@ - (void)setBackgroundColorTransparent { [self getNavigaitonBarScrollEdgeAppearance].backgroundEffect = nil; } else { - [self setBackgroundColor:[UIColor clearColor]]; + self.barTintColor = UIColor.clearColor; self.shadowImage = [UIImage new]; [self setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault]; }