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

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

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