美文网首页
iOS UITabBarItem 修改图片颜色

iOS UITabBarItem 修改图片颜色

作者: iLeooooo | 来源:发表于2020-04-30 17:20 被阅读0次
    if self.tabBar.items != nil {
        let classNameArr = ["Home","Recording","Tools","Mine"]
        for item in self.tabBar.items! {
            let clsName = classNameArr[item.tag]
            let lowStr = clsName.lowercased()
            let color = kSkinDark ? nil : UIColor(hexString: "9B9AA1")
            let image = UIImage(named: "tabbar_icon_" + lowStr + "_normal")?.imageWithTintColor(tintColor: color)
            item.image = image
        }
    }
    

    相关文章

      网友评论

          本文标题:iOS UITabBarItem 修改图片颜色

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