Browse Source

Fix largeTitle background color on iOS 13 (#6027)

Resolves largeTitle background color from topBar.title.background.color

Co-authored-by: Guy Carmeli <guyca@users.noreply.github.com>
Yogev Ben David 4 years ago
parent
commit
979cb6e08f
No account linked to committer's email address
2 changed files with 9 additions and 0 deletions
  1. 1
    0
      lib/ios/RNNComponentViewController.m
  2. 8
    0
      lib/ios/TopBarAppearancePresenter.m

+ 1
- 0
lib/ios/RNNComponentViewController.m View File

@@ -9,6 +9,7 @@
9 9
 	self.extendedLayoutIncludesOpaqueBars = YES;
10 10
     if (@available(iOS 13.0, *)) {
11 11
         self.navigationItem.standardAppearance = [UINavigationBarAppearance new];
12
+        self.navigationItem.scrollEdgeAppearance = [UINavigationBarAppearance new];
12 13
     }
13 14
 	return self;
14 15
 }

+ 8
- 0
lib/ios/TopBarAppearancePresenter.m View File

@@ -34,12 +34,16 @@
34 34
 - (void)updateBackgroundAppearance {
35 35
     if (self.transparent) {
36 36
         [self.getAppearance configureWithTransparentBackground];
37
+        [self.getScrollEdgeAppearance configureWithTransparentBackground];
37 38
     } else if (self.backgroundColor) {
38 39
         [self.getAppearance setBackgroundColor:self.backgroundColor];
40
+        [self.getScrollEdgeAppearance setBackgroundColor:self.backgroundColor];
39 41
     } else if (self.translucent) {
40 42
         [self.getAppearance configureWithDefaultBackground];
43
+        [self.getScrollEdgeAppearance configureWithDefaultBackground];
41 44
     } else {
42 45
         [self.getAppearance configureWithOpaqueBackground];
46
+        [self.getScrollEdgeAppearance configureWithOpaqueBackground];
43 47
     }
44 48
 }
45 49
 
@@ -74,4 +78,8 @@
74 78
     return self.currentNavigationItem.standardAppearance;
75 79
 }
76 80
 
81
+- (UINavigationBarAppearance *)getScrollEdgeAppearance {
82
+    return self.currentNavigationItem.scrollEdgeAppearance;
83
+}
84
+
77 85
 @end