zoukankan      html  css  js  c++  java
  • iOS tabbar 属性

    1.设置tabbar背景颜色

    1 NSArray *controllers = [NSArray arrayWithObjects:nav_main,nav_channle,nav_me, nil];
    2     _tabController.viewControllers = controllers;
    3     _tabController.delegate = self;
    4     
    5     for (int i=0;i<self.tabController.viewControllers.count;i++) {
    6         UIViewController *viewController = [self.tabController.viewControllers objectAtIndex:i];
    7         // 设置tabbar 背景颜色
    8         [viewController.tabBarController.tabBar setBackgroundImage:[UIImage imageWithColor:kTabBarBackgroundColor]];
    9     }

    2.ios7.ios6选中 未选中颜色

     [[UITabBarItem appearance]setTitleTextAttributes:@{ UITextAttributeTextColor : cMainColor }
                                                    forState:UIControlStateSelected];
            [[UITabBarItem appearance] setTitleTextAttributes:@{ UITextAttributeTextColor : cTabUnselect }
                                                     forState:UIControlStateNormal];

    以下添加font属性

    [[UITabBarItem appearance] setTitleTextAttributes:@{NSFontAttributeName : [UIFont fontWithName:@"HelveticaNeue-Bold" size:10.0f],
                                                        NSForegroundColorAttributeName : appTintColor
                                                        } forState:UIControlStateSelected];
    
    
    // doing this results in an easier to read unselected state then the default iOS 7 one
    [[UITabBarItem appearance] setTitleTextAttributes:@{NSFontAttributeName : [UIFont fontWithName:@"HelveticaNeue-Bold" size:10.0f],
                                                        NSForegroundColorAttributeName : [UIColor colorWithRed:.5 green:.5 blue:.5 alpha:1]
                                                        } forState:UIControlStateNormal];
  • 相关阅读:
    [CTF]zip伪加密
    Node.js躬行记(5)——定时任务的调试
    不一样的资产安全 3D 可视化平台
    冬季里有温度的 3D 可视化智慧供热系统
    公路项目建设可视化进度管理
    ElementUI时间选择控件提交的时间为UTC时间
    Orcal创建触发器
    Orcal常用查询实例集合
    代码优化风格分享
    查某月的天数
  • 原文地址:https://www.cnblogs.com/lihaibo-Leao/p/3752586.html
Copyright © 2011-2022 走看看