1、创建一个Veiw 把View插入到tabbarViewcontroller insetViewatIndex:0]
2、设置tabbar的delegate方法:- (void)tabBarController:(UITabBarController )tabBarController didSelectViewController:(UIViewController )viewController里设置uiview的frame为屏幕宽度/4 * 49,`- (void)tabBarController:(UITabBarController )tabBarController didSelectViewController:(UIViewController )viewController
{
NSInteger index = tabBarController.selectedIndex;
selectView.frame = CGRectMake([UIScreen mainScreen].bounds.size.width/4 * index, 0, [UIScreen mainScreen].bounds.size.width/4, 49);
}`就可以实现这种效果
3、当需要直接跳转到某一个tabbar时点击效果会有异常只需这样写就可以完美解决[self.tabBarController setSelectedIndex:0];
[self.tabBarController.delegate tabBarController:self.tabBarController didSelectViewController:self];