Created
July 22, 2014 14:40
-
-
Save bleft/587ffa4745800bf4a671 to your computer and use it in GitHub Desktop.
set maximum number of lines on UITextView
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// the following snippet sets the number of lines to 1 | |
myTextView.attributedText = [[NSAttributedStringalloc] initWithString:@"my too long text"]; | |
myTextView.textContainer.maximumNumberOfLines = 1; | |
myTextView.textContainer.lineBreakMode = NSLineBreakByTruncatingTail; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment