1 2 3 4 5 6 7 8 9 10
|
NSMutableParagraphStyle * paragraphStyle = [[NSMutableParagraphStyle alloc] init]; paragraphStyle.lineSpacing = 0.0f; paragraphStyle.alignment = NSTextAlignmentJustified; paragraphStyle.lineBreakMode = NSLineBreakByWordWrapping; NSMutableAttributedString * attributedStringM = [[NSMutableAttributedString alloc] initWithString:text attributes:@{NSParagraphStyleAttributeName : paragraphStyle,NSFontAttributeName : [UIFont systemFontOfSize:16.0f]}]; UITextView * textView = [[UITextView alloc] initWithFrame:CGRectMake(10, 20, CGRectGetWidth(self.view.frame) - 20, CGRectGetHeight(self.view.frame) - 20)]; textView.attributedText = attributedStringM; textView.editable = NO; [self.view addSubview:textView];
|
近期评论