iOS textview排版
- (IBAction)changeText:(id)sender {
NSMutableParagraphStyle*paragraphStyle = [[NSMutableParagraphStylealloc]init];
paragraphStyle.alignment=NSTextAlignmentCenter;
paragraphStyle.paragraphSpacing=12.0f;
NSMutableDictionary*attributes = [NSMutableDictionarydictionary];
attributes[NSParagraphStyleAttributeName] = paragraphStyle;
attributes[NSFontAttributeName] = [UIFontfontWithName:@"Futura"size:20.0f];
attributes[NSForegroundColorAttributeName] = [UIColorcolorWithRed:1.0fgreen:0blue:0alpha:1.0f];
NSAttributedString*attriStr = [[NSAttributedStringalloc]initWithString:self.mytextView.textattributes:attributes];
self.mytextView.attributedText= attriStr;
}
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。