zoukankan      html  css  js  c++  java
  • 关于UITabBarController的设置(iOS 开发)

    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;

  • 相关阅读:
    bzoj1724[Usaco2006 Nov]Fence Repair 切割木板*
    vue-cli脚手架和webpack-simple模板项目
    Vue-router 进阶
    前端路由vue-router介绍
    vue的一些特殊特性
    生命周期钩子
    过滤器
    RSA加密算法
    欧几里得算法
    动态规划
  • 原文地址:https://www.cnblogs.com/danMing-love/p/7404434.html
Copyright © 2011-2022 走看看