Skip to content

Commit

Permalink
Update ReadMe.md
Browse files Browse the repository at this point in the history
添加简介以及用法
  • Loading branch information
yhjiang committed May 28, 2014
1 parent a1d389f commit 901f8a0
Showing 1 changed file with 42 additions and 1 deletion.
43 changes: 42 additions & 1 deletion ReadMe.md
Original file line number Diff line number Diff line change
@@ -1 +1,42 @@
自定义的Tabbar

##介绍

CustomTabBar是一款自定义的Tabbar,继承UITabbarViewController,可自定义tab图片,背景,以及选中背景。


##截图
<img width="320" height="480" src="https://raw.githubusercontent.com/yhjiang/CustomTabBar/master/ScreenShot1.png"/>


##用法
```
//初始化ViewController
FirstViewController *home = [[FirstViewController alloc] init];
home.title = @"首页";
SecondViewController *list = [[SecondViewController alloc] init];
list.title = @"推荐";
ThirdViewController *search = [[ThirdViewController alloc] init];
search.title = @"搜索";
FourthViewController *more = [[FourthViewController alloc] init];
more.title = @"更多";
//创建导航
UINavigationController *nav1 = [[UINavigationController alloc] initWithRootViewController:home];
UINavigationController *nav2 = [[ UINavigationController alloc] initWithRootViewController:list];
UINavigationController *nav3 = [[UINavigationController alloc] initWithRootViewController:search];
UINavigationController *nav4 = [[UINavigationController alloc]initWithRootViewController:more];
//把VC放到数组中
NSMutableArray *controllers = [NSMutableArray arrayWithArray:@[nav1,nav2,nav3,nav4]];
//初始化Tabbarcontroller
_tabbarController = [[YHCustomTabbar alloc] init];
_tabbarController.viewControllers = controllers;
_tabbarController.selectedIndex = 0;
[self.window setRootViewController:_tabbarController];
```

0 comments on commit 901f8a0

Please sign in to comment.