问题1 . 系统自带TabBar,想监听TabBarItem的点击事件,咋办?
解决办法:
1. 遵循代理 UITabBarDelegate
2. 设置代理 [self.tabBarController.tabBar setDelegate:self];
3. 实现方法,如下:(记得设置tabbaritem的tag值)
- (void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item
{
NSLog(@"tabbar==item.tag====%d", item.tag);
}
问题2:自定义TabBar,怎么办?
解决思路:
1.
2.
3. 切换控制器 self.selectedIndex = item.tag; //tabbaritem 的TAG值。
问题3: