Explorar el Código

Fixing issue #542 (#888)

Issue #542 caused an issue where setting the `tabBarButtonColor` would override the `tabBarSelectedButtonColor`. This fixes that.
Ben Kraus hace 7 años
padre
commit
7a84cbb702
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  1. 5
    1
      ios/RCCTabBarController.m

+ 5
- 1
ios/RCCTabBarController.m Ver fichero

@@ -120,7 +120,11 @@
120 120
     }
121 121
     UIImage *iconImageSelected = nil;
122 122
     id selectedIcon = tabItemLayout[@"props"][@"selectedIcon"];
123
-    if (selectedIcon) iconImageSelected = [RCTConvert UIImage:selectedIcon];
123
+    if (selectedIcon) {
124
+      iconImageSelected = [RCTConvert UIImage:selectedIcon];
125
+    } else {
126
+      iconImageSelected = [RCTConvert UIImage:icon];
127
+    }
124 128
 
125 129
     viewController.tabBarItem = [[UITabBarItem alloc] initWithTitle:title image:iconImage tag:0];
126 130
     viewController.tabBarItem.accessibilityIdentifier = tabItemLayout[@"props"][@"testID"];