In my app I have a UITableView and I want to change the text's alignment to center (not only from the sides like this
cell.textAlignment = UITextAlignmentCenter;
but from up and down, as well).
Can you help me? thanks in advance!
In my app I have a UITableView and I want to change the text's alignment to center (not only from the sides like this
cell.textAlignment = UITextAlignmentCenter;
but from up and down, as well).
Can you help me? thanks in advance!
Could you please clarify the question? If you use UITableViewCellStyleDefault
and increase cell height something like
- (CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 100;
}
then the label will be vertically centered without any effort on your part.
Also, cell.textAlignment = …
is deprecated in favor of cell.textLabel.textAlignment = …
.