文章来源:淘论文网   发布者: 毕业设计   浏览量: 27



还可以点击去查询以下关键词:
[STColorfulTabBar]    [彩色]    [定制]    [TabBar]    [加平]    [滑的]    [切换]    [动画]    [STColorfulTabBar 彩色的定制TabBar,加平滑的切换动画]   

项目介绍:

TColorfulTabBar

https://github.com/saitjr/STColorfulTabBar

彩色的TabBar,加平滑的切换动画(gif图看起来有点掉帧...)

设计图

效果展示

视图层级

这个效果的实现是通过重写TabBar,开题报告,然后给TabBar添加了一个彩色view(colorView)实现的。

视图层级如下:

使用

在UITabBarController中,将系统的UITabBar替换成TColorfulTabBar即可。(<font color = red>注:tabBarController.tabbar属性是readonly修饰的,所以要通过KVC来修改</font>)

代码如下:

TColorfulTabBar *tabBar = [[TColorfulTabBar alloc] initWithFrame:tabBarController.tabBar.frame]; [tabBarController setValue:tabBar forKey:@'tabBar'];自定义

Demo相关配置在TColorfulTabBar+Configuration这个类目当中,可以修改每个item的颜色与item的个数。

// item的颜色(个数要和item的个数相同) - (NSArray *)itemColors; // item的个数 - (NSInteger)itemCount;可能出现的问题

因为当TColorfulTabBar加载到父视图上时,我让TColorfulTabBar响应了自己的代理方法,所以如果在UITabBarController 中再次修改delegate ,可能会导致TColorfulTabBar无法拿到下标。

如果没有修改代理,那有可能会导致UITabBarController中的UITabBarDelegate无效。

Swift版本

broccolii实现了Swift版本:https://github.com/broccolii/ColorFulTabBar/tree/master

论文


这里还有:


还可以点击去查询:
[STColorfulTabBar]    [彩色]    [定制]    [TabBar]    [加平]    [滑的]    [切换]    [动画]    [STColorfulTabBar 彩色的定制TabBar,加平滑的切换动画]   

请扫码加微信 微信号:sj52abcd


下载地址: http://www.taolw.com/down/8516.docx
  • 上一篇:BLEProg毕业设计ressView
  • 下一篇:一个提高开发效率的小工定制具根据json字符串自动创建模型类