首页 > 移动平台 > 详细

关于UITabBarController的设置(iOS 开发)

时间:2017-08-21 15:30:12      阅读:257      评论:0      收藏:0      [点我收藏+]

1.设置图片(选中以及未选中)

UITabBarItem *TuiJianItem=[[UITabBarItem alloc]initWithTitle:@"我的" image:[[UIImage imageNamed:@"index_bottom07_"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] selectedImage:[[UIImage imageNamed:@"index_bottom08_"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];

 2.设置选中状态字体颜色

    [tabBarItem setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:

                                        [UIFont fontWithName:@"Helvetica-Bold" size:10],

                                        NSFontAttributeName,[UIColor colorWithRed:153/255.0 green:153/255.0 blue:153/255.0 alpha:1],NSForegroundColorAttributeName,

                                        nil] forState:UIControlStateNormal];

3.常规设置

    UITabBarController *tabBar=[[UITabBarController alloc]init];

    tabBar.viewControllers=@[_homeNav,_erShouNav,_orderNav,_tuiJianNav];

    tabBar.view.backgroundColor = [UIColor whiteColor];

    tabBar.selectedIndex = 0;//默认展示页

    tabBar.delegate=self;

 

关于UITabBarController的设置(iOS 开发)

原文:http://www.cnblogs.com/danMing-love/p/7404434.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!