views:

546

answers:

1

Which is the detailTextLabel, and which is the textLabel? The small blue text or the larger black text?

I would like my textLabel (black text) to be right aligned, so i have tried this, but no success.

cell.textLabel.textAlignment = UITextAlignmentRight;
cell.detailTextLabel.textAlignment = UITextAlignmentRight; //tried this just in
                                                           //case, but no luck.

Why wont my cells align properly? I have init'd them with the Value2 style.

Thanks

A: 

textLabel is the larger, blue text, and detailTextLabel is the smaller, black text. UITableViewCellStyleValue2 sets textLabel left-aligned and detailTextLabel right-aligned.

You can access the contentView and create subviews to add to it if you want fine-grained control over your styles.

Don