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;

  • 相关阅读:
    HTML if条件注释解读
    Springboot整合logback日志系统
    Springboot @Valid 参数校验
    JDK1.8 版的if else
    Android获取手机定位坐标
    CentOS8安装JDK
    Vue全局配置文件
    git学习
    百度前端面试题—基础
    前端知识网络
  • 原文地址:https://www.cnblogs.com/danMing-love/p/7404434.html
Copyright © 2011-2022 走看看