欧美三级国产三级日韩三级_亚洲熟妇丰满大屁股熟妇_欧美亚洲成人一区二区三区_国产精品久久久久久模特

修改UITabBarItem的字體顏色 - 新聞資訊 - 云南小程序開發(fā)|云南軟件開發(fā)|云南網(wǎng)站建設(shè)-昆明葵宇信息科技有限公司

159-8711-8523

云南網(wǎng)建設(shè)/小程序開發(fā)/軟件開發(fā)

知識(shí)

不管是網(wǎng)站,軟件還是小程序,都要直接或間接能為您產(chǎn)生價(jià)值,我們?cè)谧非笃湟曈X表現(xiàn)的同時(shí),更側(cè)重于功能的便捷,營銷的便利,運(yùn)營的高效,讓網(wǎng)站成為營銷工具,讓軟件能切實(shí)提升企業(yè)內(nèi)部管理水平和效率。優(yōu)秀的程序?yàn)楹笃谏?jí)提供便捷的支持!

您當(dāng)前位置>首頁 » 新聞資訊 » 技術(shù)分享 >

修改UITabBarItem的字體顏色

發(fā)表時(shí)間:2021-1-10

發(fā)布人:葵宇科技

瀏覽次數(shù):55

修改UITabBarItem下面字體的顏色,如圖:


[img]http://img.blog.csdn.net/20150108133337062

[[UITabBarItemappearance] setTitleTextAttributes:[NSDictionarydictionaryWithObjectsAndKeys:[UIColorblackColor], UITextAttributeTextColor,nil] forState:UIControlStateNormal];
    [[UITabBarItemappearance] setTitleTextAttributes:   [NSDictionarydictionaryWithObjectsAndKeys:[UIColorredColor],UITextAttributeTextColor,nil]forState:UIControlStateSelected];
這個(gè)時(shí)候會(huì)報(bào)警告'UITextAttributeTextColor' is deprecated in iOS 7. The iOS 7 key is 'NSForegroundColorAttributeName

然后替換一下就可以了,不過NSForegroundColorAttributeName最底支持到ios6.0
[[UITabBarItemappearance] setTitleTextAttributes:[NSDictionarydictionaryWithObjectsAndKeys:[UIColorblackColor], NSForegroundColorAttributeName,nil] forState:UIControlStateNormal];
    [[UITabBarItemappearance] setTitleTextAttributes:  [NSDictionarydictionaryWithObjectsAndKeys:[UIColorredColor],NSForegroundColorAttributeName,nil]forState:UIControlStateSelected];
以上是改變字體顏色的,圖片顏色無法改變,
[[UITabBar appearance]setTintColor:[UIColor redColor]];
但是上面這一句就可以改變并設(shè)置點(diǎn)擊后的圖片和文字顏色了。

相關(guān)案例查看更多