axclogo / AxcAE_TabBar

AxcAE_TabBar, a special effects TabBar, is a TabBar component that encapsulates openness at its core. It offers all properties, APIs, and other parameters to the user as open as possible, making it a TabBar option component that can be used conveniently and quickly
MIT License
511 stars 84 forks source link

如何动态更新title和image? #8

Closed yangzheng006 closed 6 years ago

axclogo commented 6 years ago

如果是从VC中更新则: BaseTabBar tabBarVC = (BaseTabBar )self.tabBarController; AxcAE_TabBarItem item = tabBarVC.axcTabBar.currentSelectItem; // 因为已经到这个页面,说明就是当前的选项卡item // 或者可以这么获取 // AxcAE_TabBarItem item = tabBarVC.axcTabBar.tabBarItems[2]; // 这个下标是固定的,代表这个页面下的item 获取到item后就可以设置其中的各种属性了 item中的所有参数有: // 标题 @property (nonatomic, copy) NSString title; // 默认标题颜色 @property (nonatomic, strong) UIColor normalColor; // 选中标题颜色 @property (nonatomic, strong) UIColor selectColor; // 默认的 Image @property (nonatomic, strong) UIImage normalImage; // 选中的 Image @property (nonatomic, strong) UIImage selectImage; // 默认的 图片tintColor @property(nonatomic, strong)UIColor normalTintColor; // 选中的 图片tintColor @property(nonatomic, strong)UIColor selectTintColor; // 默认的 按钮背景Color 默认无 @property(nonatomic, strong)UIColor normalBackgroundColor; // 选中的 按钮背景Color 默认无 @property(nonatomic, strong)UIColor selectBackgroundColor; // 单个item的背景图 @property(nonatomic, strong)UIImageView backgroundImageView; // 角标内容 @property(nonatomic, strong)NSString *badge; // item的所在索引 @property(nonatomic, assign)NSInteger itemIndex;

// 选中状态 @property (nonatomic, assign) BOOL isSelect; // imageView @property (nonatomic, strong) UIImageView icomImgView; // 标题Label @property (nonatomic, strong) UILabel titleLabel; // 角标Label @property(nonatomic, strong)AxcAE_TabBarBadge *badgeLabel;

看你需要设置什么了

yangzheng006 commented 6 years ago

谢谢。