如何去掉系统tabbarcontroller被点击item的高亮效果
2个回答
展开全部
自定义initWithCustomView
self.tabBar.tintColor = [UIColor colorWithHexString:BLUE_GREEN_COLOR];
UITabBarController *tabBarController = (UITabBarController*)self;
UITabBar *tabBar = tabBarController.tabBar;
UITabBarItem *trainEnquiryItem = [tabBar.items objectAtIndex:0];
[trainEnquiryItem setTitle:@"查询"];
[trainEnquiryItem setImage:[UIImage imageNamed:@"tet"]];
[trainEnquiryItem setSelectedImage:[UIImage imageNamed:@"tet_hover"]];
改变UITabBarItem 字体颜色
[[UITabBarItem appearance] setTitleTextAttributes:[NSDictionarydictionaryWithObjectsAndKeys:[UIColor whiteColor], UITextAttributeTextColor, nil] forState:UIControlStateNormal];
[[UITabBarItem appearance] setTitleTextAttributes:
[NSDictionarydictionaryWithObjectsAndKeys:[UIColorcolorWithHexString:"#00C8D3"],UITextAttributeTextColor, nil]forState:UIControlStateSelected];
self.tabBar.tintColor = [UIColor colorWithHexString:BLUE_GREEN_COLOR];
UITabBarController *tabBarController = (UITabBarController*)self;
UITabBar *tabBar = tabBarController.tabBar;
UITabBarItem *trainEnquiryItem = [tabBar.items objectAtIndex:0];
[trainEnquiryItem setTitle:@"查询"];
[trainEnquiryItem setImage:[UIImage imageNamed:@"tet"]];
[trainEnquiryItem setSelectedImage:[UIImage imageNamed:@"tet_hover"]];
改变UITabBarItem 字体颜色
[[UITabBarItem appearance] setTitleTextAttributes:[NSDictionarydictionaryWithObjectsAndKeys:[UIColor whiteColor], UITextAttributeTextColor, nil] forState:UIControlStateNormal];
[[UITabBarItem appearance] setTitleTextAttributes:
[NSDictionarydictionaryWithObjectsAndKeys:[UIColorcolorWithHexString:"#00C8D3"],UITextAttributeTextColor, nil]forState:UIControlStateSelected];
展开全部
组装uitabbarcontroller代码指定各uitabbaritem.各包含viewcontroller
UITabbarController *tabController=[[UITabbarController alloc] init];
self.vc1=[[UIViewController alloc] init];
slef.vc1.tabbarItem=......;
self.vc2=[[UIViewController alloc] init];
self.vc2.tabbarItem = ....;
UITabbarController *tabController=[[UITabbarController alloc] init];
self.vc1=[[UIViewController alloc] init];
slef.vc1.tabbarItem=......;
self.vc2=[[UIViewController alloc] init];
self.vc2.tabbarItem = ....;
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询