Browse Source

Fixing issue #542 (#888)

Issue #542 caused an issue where setting the `tabBarButtonColor` would override the `tabBarSelectedButtonColor`. This fixes that.
Ben Kraus 7 years ago
parent
commit
7a84cbb702
1 changed files with 5 additions and 1 deletions
  1. 5
    1
      ios/RCCTabBarController.m

+ 5
- 1
ios/RCCTabBarController.m View File

120
     }
120
     }
121
     UIImage *iconImageSelected = nil;
121
     UIImage *iconImageSelected = nil;
122
     id selectedIcon = tabItemLayout[@"props"][@"selectedIcon"];
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
     viewController.tabBarItem = [[UITabBarItem alloc] initWithTitle:title image:iconImage tag:0];
129
     viewController.tabBarItem = [[UITabBarItem alloc] initWithTitle:title image:iconImage tag:0];
126
     viewController.tabBarItem.accessibilityIdentifier = tabItemLayout[@"props"][@"testID"];
130
     viewController.tabBarItem.accessibilityIdentifier = tabItemLayout[@"props"][@"testID"];