国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學(xué)院 > 開發(fā)設(shè)計(jì) > 正文

UITabBar 設(shè)置選中、未選中狀態(tài)下title的字體顏色

2019-11-09 18:18:27
字體:
供稿:網(wǎng)友

一、如果只是設(shè)置選中狀態(tài)的字體顏色,使用 tintColor  就可以達(dá)到效果

self.tabBar.tintColor = [UIColor redColor];二、但如果要將未選中狀態(tài)和選中狀態(tài)下的顏色都改變,可以使用 setTitleTextAttributes:<#(nullable NSDictionary<NSString *,id> *)#> forState:<#(UIControlState)#> 達(dá)到效果

[nav.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor redColor]} forState:UIControlStateNormal];[nav.tabBarItem setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor blueColor]} forState:UIControlStateSelected];       或者

[[UITabBarItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor redColor]} forState:UIControlStateNormal];[[UITabBarItem appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName:[UIColor blueColor]} forState:UIControlStateSelected];


發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 东山县| 噶尔县| 万宁市| 鲁山县| 革吉县| 淳化县| 新民市| 灌云县| 莱西市| 鞍山市| 璧山县| 闵行区| 买车| 叙永县| 武宁县| 朝阳区| 玛多县| 兰西县| 太湖县| 蓬溪县| 桑植县| 手游| 织金县| 郴州市| 江口县| 莱阳市| 泽州县| 留坝县| 金塔县| 滕州市| 岳普湖县| 奇台县| 尉犁县| 尉氏县| 霍林郭勒市| 兴国县| 嘉兴市| 潢川县| 巴青县| 南阳市| 永吉县|