GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - saitjr/STColorfulTabBar: 彩色的TabBar,加平滑的切换动画

BranchesTags
Open more actions menu

Latest commit

 

History

16 Commits
16 Commits

Folders and files

NameName
Last commit message
Last commit date
2015-07-01-ColorfulTabBarAnimation
2015-07-01-ColorfulTabBarAnimation
 
 
README-IMAGES
README-IMAGES
 
 
README.md
README.md
 
 

Repository files navigation

TColorfulTabBar

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

设计图

效果展示

视图层级

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

视图层级如下:

使用

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

代码如下:

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;

技术支持

http://www.saitjr.com/ios/ios-colorful-tabbar-implement.html

可能出现的问题

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

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

Swift版本

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

About

彩色的TabBar,加平滑的切换动画

www.saitjr.com/ios/ios-colorful-tabbar-implement.html

Resources

Readme
Activity

Stars

169 stars

Watchers

7 watching

Forks

49 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.