Reputation: 87
I have tableViewCell which contain two labels with title and subtitle .Both have numberOfLine 0 with sizeToFit in cell class.But if text of one them is less then label text with less one, comes at center as
Cell height is base on Label text size and if both Label text have same number of line then it appear good . So i want text of both label align to top.Cell height should be base of text of Label with more number of line.
Upvotes: 0
Views: 347
Reputation: 524
This can be achieved in auto layout by setting the bottom labels constraint to >= rather than just = to the bottom of the cell in the xib. That way it should automatically fill the least amount of space so that text vertical alignment is no longer an issue.
Upvotes: 1