浏览代码

Fix black topBar background color (#5726)

* Fix black topBar background color
Yogev Ben David 5 年前
父节点
当前提交
d2ed290b58
没有帐户链接到提交者的电子邮件
共有 2 个文件被更改,包括 4 次插入6 次删除
  1. 3
    3
      lib/ios/RNNStackPresenter.m
  2. 1
    3
      lib/ios/UINavigationBar+utils.m

+ 3
- 3
lib/ios/RNNStackPresenter.m 查看文件

@@ -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 查看文件

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