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

3

5

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!

Darlington answered 9/2, 2012 at 12:23 Comment(1)
i think you ask about cell.detailTextLabel.textColor?Doctrinal
H
8
UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"cell"];
    [[cell detailTextLabel] textColor]

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

Hortative answered 9/2, 2012 at 12:36 Comment(2)
Printing this yields the equivalent of [UIColor colorWithRed:0.22 green:0.33 blue:0.53 alpha:1], FYI.Australopithecus
as of iOS 9, the value returned is Color: UIDeviceRGBColorSpace 0.556863 0.556863 0.576471 1, or in RGB values from 0-255, (142, 142, 147).Wilbert
C
2

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.

Ca answered 26/3, 2013 at 22:40 Comment(0)
F
0

I use [UIColor grayColor] for UITableViewCell.detailsTextLabel.textColor. At the first glance there is no diference betwen grayColor and original one.

Fronniah answered 15/5, 2013 at 9:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.