美文网首页
UITabBarItem 颜色,字体大小修改

UITabBarItem 颜色,字体大小修改

作者: 自弹自唱 | 来源:发表于2018-07-01 08:08 被阅读0次
    letattrsNormal:[NSAttributedStringKey:Any] = [
    
            .strokeColor : UIColor.black,
    
            .foregroundColor : UIColor.black,
    
            .font:UIFont.systemFont(ofSize:20)
    
        ]
    
        letattrsSelected:[NSAttributedStringKey:Any] = [
    
    
    
            .strokeColor : UIColor.red,
    
            .foregroundColor : UIColor.red,
    
            .font:UIFont.systemFont(ofSize:20) 
    
        ]
    
    
    
        UITabBarItem.appearance().setTitleTextAttributes(attrsNormal as [NSAttributedStringKey : Any], for: .normal)
    
        UITabBarItem.appearance().setTitleTextAttributes(attrsSelected as [NSAttributedStringKey : Any], for: .selected)
    

    相关文章

      网友评论

          本文标题:UITabBarItem 颜色,字体大小修改

          本文链接:https://www.haomeiwen.com/subject/wqzquftx.html