Explorar el Código

Fix black topBar background color (#5726)

* Fix black topBar background color
Yogev Ben David hace 5 años
padre
commit
d2ed290b58
No account linked to committer's email address
Se han modificado 2 ficheros con 4 adiciones y 6 borrados
  1. 3
    3
      lib/ios/RNNStackPresenter.m
  2. 1
    3
      lib/ios/UINavigationBar+utils.m

+ 3
- 3
lib/ios/RNNStackPresenter.m Ver fichero

@@ -29,15 +29,15 @@
29 29
 	self.interactivePopGestureDelegate.originalDelegate = stack.interactivePopGestureRecognizer.delegate;
30 30
 	stack.interactivePopGestureRecognizer.delegate = self.interactivePopGestureDelegate;
31 31
 
32
+    [stack setBarStyle:[RCTConvert UIBarStyle:[withDefault.topBar.barStyle getWithDefaultValue:@"default"]]];
33
+    [stack setNavigationBarTranslucent:[withDefault.topBar.background.translucent getWithDefaultValue:NO]];
34
+    [stack setNavigationBarNoBorder:[withDefault.topBar.noBorder getWithDefaultValue:NO]];
32 35
     [stack setTopBarBackgroundColor:[withDefault.topBar.background.color getWithDefaultValue:nil]];
33 36
 	[stack setInteractivePopGestureEnabled:[withDefault.popGesture getWithDefaultValue:YES]];
34 37
 	[stack setRootBackgroundImage:[withDefault.rootBackgroundImage getWithDefaultValue:nil]];
35 38
 	[stack setNavigationBarTestId:[withDefault.topBar.testID getWithDefaultValue:nil]];
36 39
 	[stack setNavigationBarVisible:[withDefault.topBar.visible getWithDefaultValue:YES] animated:[withDefault.topBar.animate getWithDefaultValue:YES]];
37 40
 	[stack hideBarsOnScroll:[withDefault.topBar.hideOnScroll getWithDefaultValue:NO]];
38
-	[stack setNavigationBarNoBorder:[withDefault.topBar.noBorder getWithDefaultValue:NO]];
39
-	[stack setBarStyle:[RCTConvert UIBarStyle:[withDefault.topBar.barStyle getWithDefaultValue:@"default"]]];
40
-	[stack setNavigationBarTranslucent:[withDefault.topBar.background.translucent getWithDefaultValue:NO]];
41 41
 	[stack setNavigationBarClipsToBounds:[withDefault.topBar.background.clipToBounds getWithDefaultValue:NO]];
42 42
 	[stack setNavigationBarBlur:[withDefault.topBar.background.blur getWithDefaultValue:NO]];
43 43
 	[stack setNavigationBarLargeTitleVisible:[withDefault.topBar.largeTitle.visible getWithDefaultValue:NO]];

+ 1
- 3
lib/ios/UINavigationBar+utils.m Ver fichero

@@ -1,7 +1,6 @@
1 1
 #import "UINavigationBar+utils.h"
2 2
 #import "RNNFontAttributesCreator.h"
3 3
 
4
-
5 4
 @implementation UINavigationBar (utils)
6 5
 
7 6
 - (void)rnn_setBackIndicatorImage:(UIImage *)image {
@@ -70,7 +69,6 @@
70 69
         [self getNavigaitonBarCompactAppearance].backgroundColor = color;
71 70
         [self getNavigaitonBarScrollEdgeAppearance].backgroundColor = color;
72 71
     } else {
73
-        [super setBackgroundColor:color];
74 72
         self.barTintColor = color;
75 73
     }
76 74
 }
@@ -86,7 +84,7 @@
86 84
         [self getNavigaitonBarScrollEdgeAppearance].backgroundEffect = nil;
87 85
         
88 86
     } else {
89
-        [self setBackgroundColor:[UIColor clearColor]];
87
+        self.barTintColor = UIColor.clearColor;
90 88
         self.shadowImage = [UIImage new];
91 89
         [self setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
92 90
     }