|
@@ -13,8 +13,23 @@
|
13
|
13
|
|
14
|
14
|
- (void)applyOn:(UIViewController *)viewController {
|
15
|
15
|
if (self.title || self.icon) {
|
16
|
|
- UITabBarItem* tabItem = [[UITabBarItem alloc] initWithTitle:self.title image:[RCTConvert UIImage:self.icon] tag:self.tag];
|
|
16
|
+ UITabBarItem* tabItem = [[UITabBarItem alloc] initWithTitle:nil image:[RCTConvert UIImage:self.icon] tag:self.tag];
|
17
|
17
|
tabItem.accessibilityIdentifier = self.testID;
|
|
18
|
+
|
|
19
|
+ if (self.iconInsets && ![self.iconInsets isKindOfClass:[NSNull class]]) {
|
|
20
|
+ id topInset = self.iconInsets[@"top"];
|
|
21
|
+ id leftInset = self.iconInsets[@"left"];
|
|
22
|
+ id bottomInset = self.iconInsets[@"bottom"];
|
|
23
|
+ id rightInset = self.iconInsets[@"right"];
|
|
24
|
+
|
|
25
|
+ CGFloat top = topInset != (id)[NSNull null] ? [RCTConvert CGFloat:topInset] : 0;
|
|
26
|
+ CGFloat left = topInset != (id)[NSNull null] ? [RCTConvert CGFloat:leftInset] : 0;
|
|
27
|
+ CGFloat bottom = topInset != (id)[NSNull null] ? [RCTConvert CGFloat:bottomInset] : 0;
|
|
28
|
+ CGFloat right = topInset != (id)[NSNull null] ? [RCTConvert CGFloat:rightInset] : 0;
|
|
29
|
+
|
|
30
|
+ tabItem.imageInsets = UIEdgeInsetsMake(top, left, bottom, right);
|
|
31
|
+ }
|
|
32
|
+
|
18
|
33
|
[viewController.navigationController setTabBarItem:tabItem];
|
19
|
34
|
}
|
20
|
35
|
|
|
@@ -43,6 +58,7 @@
|
43
|
58
|
self.visible = nil;
|
44
|
59
|
self.icon = nil;
|
45
|
60
|
self.testID = nil;
|
|
61
|
+ self.iconInsets = nil;
|
46
|
62
|
}
|
47
|
63
|
|
48
|
64
|
@end
|