Skip to content

Commit

Permalink
Fix black topBar background color (#5726)
Browse files Browse the repository at this point in the history
* Fix black topBar background color
  • Loading branch information
yogevbd authored Dec 5, 2019
1 parent 65118b1 commit d2ed290
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lib/ios/RNNStackPresenter.m
Original file line number Diff line number Diff line change
Expand Up @@ -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]];
Expand Down
4 changes: 1 addition & 3 deletions lib/ios/UINavigationBar+utils.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#import "UINavigationBar+utils.h"
#import "RNNFontAttributesCreator.h"


@implementation UINavigationBar (utils)

- (void)rnn_setBackIndicatorImage:(UIImage *)image {
Expand Down Expand Up @@ -70,7 +69,6 @@ - (void)setBackgroundColor:(UIColor *)color {
[self getNavigaitonBarCompactAppearance].backgroundColor = color;
[self getNavigaitonBarScrollEdgeAppearance].backgroundColor = color;
} else {
[super setBackgroundColor:color];
self.barTintColor = color;
}
}
Expand All @@ -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];
}
Expand Down

0 comments on commit d2ed290

Please sign in to comment.