Explorar el Código

Another topBar background fix

yogevbd hace 5 años
padre
commit
f202c7ec03
Se han modificado 2 ficheros con 5 adiciones y 12 borrados
  1. 4
    11
      lib/ios/TopBarAppearancePresenter.m
  2. 1
    1
      lib/ios/TopBarPresenter.m

+ 4
- 11
lib/ios/TopBarAppearancePresenter.m Ver fichero

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

+ 1
- 1
lib/ios/TopBarPresenter.m Ver fichero

@@ -126,7 +126,7 @@
126 126
 }
127 127
 
128 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 132
 @end