Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UITableViewCell Detail Text Label Text Color

I have noticed that if I instantiate UITableViewCell instances programmatically, specifying the style .value1 (UITableViewCellStyleValue1), the main text label text color is black, but the detail text label text color is a light shade of gray (not quite exactly UIColor.gray or UIColor.lightGray, though).

However, if I use a storyboard with prototype, static cells and set their Style attribute to "Right Detail" (which appears to be the Interface Builder equivalent of .value1), both labels are black.

I can navigate the cell's subviews all the way to the label and change the text color in the attribute inspector, but I'm not sure the color preset is there.

Is there a right way to unify the appearances of cells in both scenarios, while keeping the traditional gray color in the detail text label?

(I would use dynamic cells and instantiate them programmatically, but this one view controller just happens to have these off-the-shelf cells side-by-side with more complex, custom cells.)

like image 458
Nicolas Miari Avatar asked Dec 06 '16 08:12

Nicolas Miari


2 Answers

I was also annoyed by the same problem.

Finally I found that Xcode 7.3.1 generated a detail text label with text color R:142, G:142, B:147 (#8E8E93). Xcode 8.2 generates it with black text color. ('Default', to be exact)

Anyway, changing the label's color to R:142, G:142, B:147 (#8E8E93) is an appropriate one, I think so.

like image 136
Hiron Avatar answered Sep 28 '22 03:09

Hiron


I had the same issue and logged a bug report in the Apple Bug Reporter. My bug report was closed with the comments "Duplicate of 28317724 (Open)". I am not sure if bug reports other than your own are visible, the system does not appear to be very transparent.

like image 29
Roj Avatar answered Sep 28 '22 03:09

Roj