Guest User

Untitled

a guest
Aug 20th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. How do I get UILineBreakModeTailTruncation to reliably truncate ONLY on the last line?
  2. CGSize stringSize;
  3. NSString *string = label.text;
  4.  
  5. CGSize maximumLabelSize = CGSizeMake(contentRect.size.width, 50);
  6. stringSize = [string sizeWithFont:label.font
  7. constrainedToSize:maximumLabelSize
  8. lineBreakMode:self.label.lineBreakMode];
  9.  
  10. label.frame = CGRectMake(CELL_PADDING, CELL_PADDING, contentRect.size.width - CELL_PADDING*2, stringSize.height);
  11. }
Add Comment
Please, Sign In to add comment