Skip to content

Commit 893b127

Browse files
committed
Create README.md
1 parent f7e2bae commit 893b127

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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! :)

0 commit comments

Comments
 (0)