iOS - 设置TabBarItem被选中时的背景
来源:互联网 发布:mac命令行怎么查找文件 编辑:程序博客网 时间:2024/05/17 09:20
在TabBarController中设置代理并遵守协议<UITabBarControllerDelegate>
- (void)viewDidLoad { [super viewDidLoad]; self.delegate = self; // 添加选中的背景 self.itemSelectedBg = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"tab_bg_halo"]]; self.itemSelectedBg.frame = CGRectMake(0, 0, kScreenW / 4, 49); [self.tabBar addSubview:self.itemSelectedBg];}实现代理方法
- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController { NSInteger index = tabBarController.selectedIndex; self.itemSelectedBg.frame = CGRectMake(index * kScreenW / 4, 0, kScreenW / 4, 49);}
OK,完事~
0 0
- iOS - 设置TabBarItem被选中时的背景
- iOS tabBarItem的选中与非选中时,背景颜色,字体颜色
- tabbaritem选中时的图片设置
- IOS tableView 选中时的背景颜色设置
- 设置tabbaritem的title颜色(选中和未选中)
- tabBarItem 选中和未选中的图片设置
- iOS 如何修改tabbaritem选中后的文字颜色
- ios 设置UITableView 选中行cell的背景颜色(自定义选中的背景颜色)
- tabBarItem的选中抖动效果
- 【iOS开发-31】UITabBar背景、icon图标颜色、被选中背景设置以及隐藏UITabBar的两种方式
- iOS开发UITabBar背景、icon图标颜色、被选中背景设置以及隐藏UITabBar的两种方式
- 设置morenavigationcontroller的tabbaritem
- tabBar中tabBarItem选中颜色自定义设置
- iOS中设置导航栏的背景颜色和标题字体以及颜色,以及tabBarItem的图片和字体颜色的设置
- 设置tabbar有被选中的效果,添加背景
- cell被选中时的背景颜色
- tabbaritem的字体颜色设置
- 设置tabBarItem的图片渲染
- HTML第六章上机练习5
- 数据库的一级缓存和二级缓存的区别
- 常用 Java 静态代码分析工具的分析与比较
- Python网络爬虫之模拟登录(以知乎为例)
- Mysql学习总结(38)——21条MySql性能优化经验
- iOS - 设置TabBarItem被选中时的背景
- linux常用命令—进程(jps\ps\top)
- (快速入门5)导出 Android 工程、应用
- HTML第六章上机练习5
- 移位运算与除法、取模运算
- 编译时类型/运行时类型
- oracle 10.2.0.1没有catnoawr.sql
- hdu 2068 错排+组合数
- Jenkins更改Parameterized Trigger Plugin以支持fail or abort结果