I found this post for aligning a text label top that was very helpful.
- (void)sizeToFitFixedWidth:(NSInteger)fixedWidth
{
self.frame = CGRectMake(self.frame.origin.x, self.frame.origin.y, fixedWidth, 0);
self.lineBreakMode = UILineBreakModeWordWrap;
self.numberOfLines = 0;
[self sizeToFit];
}
Is there a way to extend this to:
- Set a max pixel height or number of rows for the label
- Get the label to respect the Line Breaks: Truncate Tail setting as found in Interface Builder.
Thanks for sharing.