Pregunta

I've got a tableView of type Plain containing one PrototypeCell of Type Custom. The prototype cells class is the default UITableViewCell class, as I'm NOT using any specialized subclass.TableViewCell settings...
The problem is, that I simply want to style the textlabels contained within the default UITableViewCell (textLabel and detailTextLabel) by using UIAppearance for iOS7.

I've tried

[[UILabel appearance]] appearanceWhenContainedIn:[UITableViewCell class], nil] setTextColor:UIColor.redColor];

to no avail. I know that the Apple documentation states, that the default labels mentioned above are always created with the default font and with textcolor black. However I expected, that styling the UILabels with appearance should work out. Any ideas regarding that topic?

REMARK: I know it's possible to set the textcolors usingcell.textLabel.textColor = UIColor.redColor, but I want to define the styling once.

¿Fue útil?

Solución

If you want to use this two labels, you don't have a Custom cell but a Subtitle cell. And still you can change the properties of these labels in the IB.

Just double click on the labels to change their properties. (Or have a look in ContentView on the left):

Subtitle Cell text label properties

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top