Browse Source

Another topBar background fix

yogevbd 5 years ago
parent
commit
f202c7ec03
2 changed files with 5 additions and 12 deletions
  1. 4
    11
      lib/ios/TopBarAppearancePresenter.m
  2. 1
    1
      lib/ios/TopBarPresenter.m

+ 4
- 11
lib/ios/TopBarAppearancePresenter.m View File

9
 @implementation TopBarAppearancePresenter {
9
 @implementation TopBarAppearancePresenter {
10
     UINavigationBarAppearance* _appearance;
10
     UINavigationBarAppearance* _appearance;
11
 }
11
 }
12
-@synthesize backgroundColor = _backgroundColor;
13
-@synthesize translucent = _translucent;
14
 
12
 
15
 - (instancetype)initWithNavigationController:(UINavigationController *)boundNavigationController {
13
 - (instancetype)initWithNavigationController:(UINavigationController *)boundNavigationController {
16
     self = [super initWithNavigationController:boundNavigationController];
14
     self = [super initWithNavigationController:boundNavigationController];
20
 }
18
 }
21
 
19
 
22
 - (void)setTranslucent:(BOOL)translucent {
20
 - (void)setTranslucent:(BOOL)translucent {
23
-    _translucent = translucent;
21
+    [super setTranslucent:translucent];
24
     [self updateBackgroundAppearance];
22
     [self updateBackgroundAppearance];
25
 }
23
 }
26
 
24
 
28
     [self updateBackgroundAppearance];
26
     [self updateBackgroundAppearance];
29
 }
27
 }
30
 
28
 
31
-- (void)setBackgroundColor:(UIColor *)backgroundColor {
32
-    _backgroundColor = backgroundColor;
33
-    [self updateBackgroundAppearance];
34
-}
35
-
36
 - (void)updateBackgroundAppearance {
29
 - (void)updateBackgroundAppearance {
37
     if (self.transparent) {
30
     if (self.transparent) {
38
         [_appearance configureWithTransparentBackground];
31
         [_appearance configureWithTransparentBackground];
39
-    } else if (_backgroundColor) {
40
-        [_appearance setBackgroundColor:_backgroundColor];
41
-    } else if (_translucent) {
32
+    } else if (self.backgroundColor) {
33
+        [_appearance setBackgroundColor:self.backgroundColor];
34
+    } else if (self.translucent) {
42
         [_appearance configureWithDefaultBackground];
35
         [_appearance configureWithDefaultBackground];
43
     } else {
36
     } else {
44
         [_appearance configureWithOpaqueBackground];
37
         [_appearance configureWithOpaqueBackground];

+ 1
- 1
lib/ios/TopBarPresenter.m View File

126
 }
126
 }
127
 
127
 
128
 - (BOOL)transparent {
128
 - (BOOL)transparent {
129
-    return (_backgroundColor && CGColorGetAlpha(_backgroundColor.CGColor) == 0.0);
129
+    return (self.backgroundColor && CGColorGetAlpha(self.backgroundColor.CGColor) == 0.0);
130
 }
130
 }
131
 
131
 
132
 @end
132
 @end