react-native-navigation的迁移库

TabBarItemAppearanceCreator.m 962B

12345678910111213141516171819202122
  1. #import "TabBarItemAppearanceCreator.h"
  2. @implementation TabBarItemAppearanceCreator
  3. + (UITabBarItem *)createTabBarItem:(UITabBarItem *)mergeItem {
  4. UITabBarItem* tabBarItem = [super createTabBarItem:mergeItem];
  5. tabBarItem.standardAppearance = mergeItem.standardAppearance ?: [[UITabBarAppearance alloc] init];
  6. return tabBarItem;
  7. }
  8. + (void)setTitleAttributes:(UITabBarItem *)tabItem titleAttributes:(NSDictionary *)titleAttributes {
  9. [super setTitleAttributes:tabItem titleAttributes:titleAttributes];
  10. tabItem.standardAppearance.stackedLayoutAppearance.normal.titleTextAttributes = titleAttributes;
  11. }
  12. + (void)setSelectedTitleAttributes:(UITabBarItem *)tabItem selectedTitleAttributes:(NSDictionary *)selectedTitleAttributes {
  13. [super setSelectedTitleAttributes:tabItem selectedTitleAttributes:selectedTitleAttributes];
  14. tabItem.standardAppearance.stackedLayoutAppearance.selected.titleTextAttributes = selectedTitleAttributes;
  15. }
  16. @end