Code Monkey home page Code Monkey logo

fktabbarcontroller's Introduction

FKTabBarController

分类导航控制器、自定义UITabBarController

测试环境:Xcode 7 iOS9

自定义TabBar,实现点击按钮实现动画效果(放大后缩小再还原) 效果还不错欢迎大家点赞,谢谢

image image image

/** 添加子控制器 */
UIViewController *hallVC = [[FirstViewController alloc] init];
[self tabBarChildViewController:hallVC norImage:[UIImage imageNamed:@"tabBar_essence_icon"] selImage:[UIImage imageNamed:@"tabBar_essence_click_icon"] title:@"essence"];

UIViewController *arenaVC = [[SecondViewController alloc] init];
[self tabBarChildViewController:arenaVC norImage:[UIImage imageNamed:@"tabBar_friendTrends_icon"] selImage:[UIImage imageNamed:@"tabBar_friendTrends_click_icon"] title:@"friend"];

UIViewController *discoverVC = [[ThreeViewController alloc] init];
[self tabBarChildViewController:discoverVC norImage:[UIImage imageNamed:@"tabBar_me_icon"] selImage:[UIImage imageNamed:@"tabBar_me_click_icon"] title:@"me"];

UIViewController *historyVC = [[FourViewController alloc] init];
[self tabBarChildViewController:historyVC norImage:[UIImage imageNamed:@"tabBar_new_icon"] selImage:[UIImage imageNamed:@"tabBar_new_click_icon"] title:@"new"];


 /** 创建自定义tabbar */
CUTabBarExtension *tabBar = [[CUTabBarExtension alloc] init];
tabBar.backgroundColor = [UIColor whiteColor];
tabBar.frame = self.tabBar.bounds;
//一定要在tabBar.items = self.itemArray;前面设置
[tabBar cu_setTabBarItemTitleColor:[UIColor blackColor] andSelTitleColor:[UIColor grayColor]];
/** 传递模型数组 */
tabBar.items = self.itemArray;
[tabBar cu_setShadeItemBackgroundColor:[UIColor cyanColor]];


// 设置中间按钮
[tabBar.centerButton setBackgroundImage:[UIImage imageNamed:@"tabBar_publish_icon"] forState:UIControlStateNormal];
[tabBar.centerButton setBackgroundImage:[UIImage imageNamed:@"tabBar_publish_click_icon"] forState:UIControlStateHighlighted];

[tabBar.centerButton addTarget:self action:@selector(chickCenterButton) forControlEvents:UIControlEventTouchUpInside];

[self.tabBar addSubview:tabBar];

fktabbarcontroller's People

Contributors

fanwenkai avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

glt3953

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.