Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. ```objective-c
  2. id imageInsets = tabItemLayout[@"props"][@"iconInsets"];
  3. if (imageInsets && imageInsets != (id)[NSNull null])
  4. {
  5. id topInset = imageInsets[@"top"];
  6. id leftInset = imageInsets[@"left"];
  7. id bottomInset = imageInsets[@"bottom"];
  8. id rightInset = imageInsets[@"right"];
  9.  
  10. CGFloat top = topInset != (id)[NSNull null] ? [RCTConvert CGFloat:topInset] : 0;
  11. CGFloat left = topInset != (id)[NSNull null] ? [RCTConvert CGFloat:leftInset] : 0;
  12. CGFloat bottom = topInset != (id)[NSNull null] ? [RCTConvert CGFloat:bottomInset] : 0;
  13. CGFloat right = topInset != (id)[NSNull null] ? [RCTConvert CGFloat:rightInset] : 0;
  14.  
  15. viewController.tabBarItem.imageInsets = UIEdgeInsetsMake(top, left, bottom, right);
  16. + viewController.tabBarItem.titlePositionAdjustment = UIOffsetMake(0, -2);
  17. }
  18. NSMutableDictionary *unselectedAttributes = [RCTHelpers textAttributesFromDictionary:tabsStyle withPrefix:@"tabBarText" baseFont:[UIFont systemFontOfSize:10]];
  19. if (!unselectedAttributes[NSForegroundColorAttributeName] && labelColor) {
  20. unselectedAttributes[NSForegroundColorAttributeName] = labelColor;
  21. }
  22. ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement