ChenYilong / CYLTabBarController

[EN]It is an iOS UI module library for adding animation to iOS tabbar items and icons with Lottie, and adding a bigger center UITabBar Item. [CN]【中国特色 TabBar】一行代码实现 Lottie 动画TabBar,支持中间带+号的TabBar样式,自带红点角标,支持动态刷新。【iOS13 & Dark Mode & iPhone XS MAX supported】
MIT License
6.92k stars 1.46k forks source link

如何自定义点击某个tabbaritem的字体颜色和icon? 其他item默认显示 #330

Closed xiaohange closed 3 years ago

xiaohange commented 5 years ago

如何自定义点击某个tabbaritem的字体颜色和icon? 其他item显示默认配置

ChenYilong commented 5 years ago

可以在这里获取到点击事件:

//CYLTabBarController.h
@protocol CYLTabBarControllerDelegate <NSObject>
@optional
/*!
 * @param tabBarController The tab bar controller containing viewController.
 * @param control Selected UIControl in TabBar.
 */
- (void)tabBarController:(UITabBarController *)tabBarController didSelectControl:(UIControl *)control;

@end

可以在这里获取到各个详细的title、icon对应的view:

//UIControl+CYLTabBarControllerExtention.h
- (UIImageView *)cyl_tabImageView;
- (UILabel *)cyl_tabLabel;
xiaohange commented 5 years ago

@ChenYilong 谢谢, 去年已解决