|
@@ -71,6 +71,8 @@
|
71
|
71
|
|
72
|
72
|
UIColor *buttonColor = nil;
|
73
|
73
|
UIColor *selectedButtonColor = nil;
|
|
74
|
+ UIColor *labelColor = nil;
|
|
75
|
+ UIColor *selectedLabelColor = nil;
|
74
|
76
|
NSDictionary *tabsStyle = props[@"style"];
|
75
|
77
|
if (tabsStyle)
|
76
|
78
|
{
|
|
@@ -82,7 +84,6 @@
|
82
|
84
|
buttonColor = color;
|
83
|
85
|
selectedButtonColor = color;
|
84
|
86
|
}
|
85
|
|
-
|
86
|
87
|
NSString *tabBarSelectedButtonColor = tabsStyle[@"tabBarSelectedButtonColor"];
|
87
|
88
|
if (tabBarSelectedButtonColor)
|
88
|
89
|
{
|
|
@@ -90,7 +91,17 @@
|
90
|
91
|
self.tabBar.tintColor = color;
|
91
|
92
|
selectedButtonColor = color;
|
92
|
93
|
}
|
93
|
|
-
|
|
94
|
+ NSString *tabBarLabelColor = tabsStyle[@"tabBarLabelColor"];
|
|
95
|
+ if(tabBarLabelColor) {
|
|
96
|
+ UIColor *color = tabBarLabelColor != (id)[NSNull null] ? [RCTConvert UIColor:tabBarLabelColor] : nil;
|
|
97
|
+ labelColor = color;
|
|
98
|
+ }
|
|
99
|
+ NSString *tabBarSelectedLabelColor = tabsStyle[@"tabBarSelectedLabelColor"];
|
|
100
|
+ if(tabBarLabelColor) {
|
|
101
|
+ UIColor *color = tabBarSelectedLabelColor != (id)[NSNull null] ? [RCTConvert UIColor:
|
|
102
|
+ tabBarSelectedLabelColor] : nil;
|
|
103
|
+ selectedLabelColor = color;
|
|
104
|
+ }
|
94
|
105
|
NSString *tabBarBackgroundColor = tabsStyle[@"tabBarBackgroundColor"];
|
95
|
106
|
if (tabBarBackgroundColor)
|
96
|
107
|
{
|
|
@@ -167,18 +178,16 @@
|
167
|
178
|
|
168
|
179
|
viewController.tabBarItem.imageInsets = UIEdgeInsetsMake(top, left, bottom, right);
|
169
|
180
|
}
|
170
|
|
-
|
171
|
181
|
NSMutableDictionary *unselectedAttributes = [RCTHelpers textAttributesFromDictionary:tabsStyle withPrefix:@"tabBarText" baseFont:[UIFont systemFontOfSize:10]];
|
172
|
|
- if (!unselectedAttributes[NSForegroundColorAttributeName] && buttonColor) {
|
173
|
|
- unselectedAttributes[NSForegroundColorAttributeName] = buttonColor;
|
|
182
|
+ if (!unselectedAttributes[NSForegroundColorAttributeName] && labelColor) {
|
|
183
|
+ unselectedAttributes[NSForegroundColorAttributeName] = labelColor;
|
174
|
184
|
}
|
175
|
185
|
|
176
|
|
- [viewController.tabBarItem setTitleTextAttributes:unselectedAttributes forState:UIControlStateNormal]
|
177
|
|
- ;
|
|
186
|
+ [viewController.tabBarItem setTitleTextAttributes:unselectedAttributes forState:UIControlStateNormal];
|
178
|
187
|
|
179
|
188
|
NSMutableDictionary *selectedAttributes = [RCTHelpers textAttributesFromDictionary:tabsStyle withPrefix:@"tabBarSelectedText" baseFont:[UIFont systemFontOfSize:10]];
|
180
|
|
- if (!selectedAttributes[NSForegroundColorAttributeName] && selectedButtonColor) {
|
181
|
|
- selectedAttributes[NSForegroundColorAttributeName] = selectedButtonColor;
|
|
189
|
+ if (!selectedAttributes[NSForegroundColorAttributeName] && selectedLabelColor) {
|
|
190
|
+ selectedAttributes[NSForegroundColorAttributeName] = selectedLabelColor;
|
182
|
191
|
}
|
183
|
192
|
|
184
|
193
|
[viewController.tabBarItem setTitleTextAttributes:selectedAttributes forState:UIControlStateSelected];
|