對(duì)于Tabbar中的選中字體顏色,常見的設(shè)置方法都是通過(guò)代碼進(jìn)行設(shè)置.
[self.tabBarController.tabBar setSelectedImageTintColor:[UIColor redColor]];
但是我更傾向于能在布局圖形界面中進(jìn)行處理的盡量不要在代碼中進(jìn)行處理,所以在storyboard中,可以在tabbar的 Show the Identity inspector 標(biāo)簽下,在User Defined Runtime Attributes中,添加項(xiàng) Keypath:selectedImageTintColor Type:Color Value:(直接點(diǎn)擊彈出調(diào)色板,設(shè)置你需要的顏色).完成后,運(yùn)行下程序,字體顏色就變了.
settingtabbar01.png