Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get the text color of a system UITableVIewCell's detail label?

I really like that feeling.

and there are also some other systems color which I cannot find their API in UIColor document,

such as the default text color of the button in the nib file, etc.

so is there any way I can use them?

I mean, they are just colors, no risk ,right?

Or is there any the RGBA value that looks alike them? thanks a lot!

like image 834
Wang Liang Avatar asked Feb 09 '12 12:02

Wang Liang


2 Answers

UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"cell"];
    [[cell detailTextLabel] textColor]

textColor will just return the UIColor object of the cells detailTextLabel.

like image 156
muffe Avatar answered Sep 29 '22 04:09

muffe


By pulling a screenshot of the simulator into Photoshop, I get the following value:

[UIColor colorWithRed:0.22 green:0.33 blue:0.55 alpha:1.0]

Looks pretty close to my eye on the device. But muffe2k's answer will always work.

like image 42
Jeff Hay Avatar answered Sep 29 '22 02:09

Jeff Hay