File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change
1
+ # dragTabBarButton
2
+ you can drag your tabBarButton
3
+
4
+ // creat our tabbar and replace the system tabbar
5
+ MYTabBar * tabBar = [ MYTabBar tabBarWithTabBarButtonImageViewTopMargin:3 tabBarButtonTitleLableTopMargin:0] ;
6
+ [ self setValue: tabBar forKeyPath:@"tabBar"] ;
7
+
8
+ // set tabbaritem image and title, if your item not have title, the UI effect look good
9
+ UINavigationController * nav0 = self.viewControllers.firstObject;
10
+ UINavigationController * nav1 = self.viewControllers.lastObject;
11
+ nav0.tabBarItem.image = [ UIImage imageNamed:@"mine"] ;
12
+ nav0.tabBarItem.selectedImage = [ UIImage imageNamed:@"mine_selected"] ;
13
+ nav0.tabBarItem.title = @"关心";
14
+ nav1.tabBarItem.image = [ UIImage imageNamed:@"news"] ;
15
+ nav1.tabBarItem.selectedImage = [ UIImage imageNamed:@"news_selected"] ;
16
+ nav1.tabBarItem.title = @"新闻";
17
+
18
+ // please copy this function in out tabBarController.m
19
+ - (void)tabBar:(UITabBar * )tabBar didSelectItem:(UITabBarItem * )item
20
+ {
21
+ self.selectedIndex = item.tag;
22
+ }
23
+
24
+ // OK! to enjoy it! Please forgive my broken English! :)
You can’t perform that action at this time.
0 commit comments