zoukankan      html  css  js  c++  java
  • UITabBar实现自定义背景及UITabBarItem自定义图片和字体

    UITabBarItem *firstItem = [[UITabBarItem alloc]initWithTitle:@"测试" image:nil tag:11];
        
     //设置字体颜色(后面设置字体状态)(UITextAttributeTextColor已过时)
      [firstItem setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys: [UIColor grayColor], UITextAttributeTextColor, nil] forState:UIControlStateNormal];

     //设置图片(选中和未选中)(此方法也已过时)
     [firstItem setFinishedSelectedImage:[UIImage imageNamed:@"local"] withFinishedUnselectedImage:[UIImage imageNamed:@"localClick"]];
    #import "MyTabBar.h"
    
    @implementation MyTabBar
    
    - (id)initWithFrame:(CGRect)frame
    {
        self = [super initWithFrame:frame];
        if (self) {
            // Initialization code
            //通过三原色设置背景颜色
            self.backgroundColor = [UIColor colorWithRed:86/250.0f green:140/250.0f blue:158/250.0f alpha:1];
        }
        return self;
    }
    
    
    // Only override drawRect: if you perform custom drawing.
    // An empty implementation adversely affects performance during animation.
    - (void)drawRect:(CGRect)rect
    {
        // Drawing code
    }
    
    
    @end
  • 相关阅读:
    项目流程
    Html5 经验
    knockoutjs 经验总结
    redmine处理规范
    用fiddler监控移动端的通讯
    git
    es6 中的 Promise
    html5游戏的横屏问题
    jQuery 学习笔记
    jQuery 里的 Promise
  • 原文地址:https://www.cnblogs.com/hw140430/p/3713378.html
Copyright © 2011-2022 走看看