开发者

iPhone: How to change font color in UITableViewCell when selected?

开发者 https://www.devze.com 2023-03-20 22:21 出处:网络
I have a UITableViewCell with labels inside my contentview. Whe开发者_JAVA技巧n I set the cell selection style to gray or blue, I want the font color in the label to be white. How can I do that?Use

I have a UITableViewCell with labels inside my contentview. Whe开发者_JAVA技巧n I set the cell selection style to gray or blue, I want the font color in the label to be white. How can I do that?


Use

cell.textLabel.highlightedTextColor = [UIColor whiteColor];


This can also be done directly in Interface Builder. Just select the cell's title or subtitle label, flip to the Attributes inspector, and select the color with this control:

iPhone: How to change font color in UITableViewCell when selected?


override the method -(void)setselected:(Bool)flag method. change the font

0

精彩评论

暂无评论...
验证码 换一张
取 消