Matrosov Alexander Matrosov Alexander - 3 months ago 23
iOS Question

UITableViewCell set style programmatically

How to create UITableViewCell with an next style (Right Detail in xib)

enter image description here

For example can I use next:

cell.style = 'Right Detail' (roughly)

Thanks!

Answer

What you want is UITableViewCellStyleValue1, but you can't set an existing cell's style: you have to set it when you're creating it. Like this:

UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"YourIdentifier"];
Comments