Is it possible to split the text into par开发者_StackOverflowagraph in a UITextView?
It's possible.
Example:
UITextView *testTextView = [[UITextView alloc] initWithFrame:frame];
[testTextView setText:@"More\nBooks"];
It's displayed like 2 strings:
More
Books
Key for answer is: \n
- end of line symbols.
use NSMutableParagraphStyle in attributed string. and check other properties instead of paragraphSpacingBefore;
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
paragraphStyle.paragraphSpacingBefore = 33.;
_textView.attributedText = [[NSAttributedString alloc] initWithString:string attributes:@{NSParagraphStyleAttributeName: paragraphStyle}];
精彩评论