美文网首页iOS开发
UITextView的一些设置

UITextView的一些设置

作者: 小黄人写代码 | 来源:发表于2015-06-09 11:41 被阅读258次
允许数据监测
[textView setDataDetectorTypes:UIDataDetectorTypeAll];
设置行高
UITextView *textView = [[UITextView alloc] init];
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
paragraphStyle.lineSpacing = 27;
NSDictionary *attributesDict = @{
         NSParagraphStyleAttributeName : paragraphStyle,
         NSFontAttributeName : [UIFont fontWithName:@"STHeitiSC-Light" size:17],
                  NSForegroundColorAttributeName : [UIColor whiteColor]
        };
textView.attributedText = [[NSAttributedString alloc] initWithString:@"xxx" attributes:attributesDict];

相关文章

网友评论

    本文标题:UITextView的一些设置

    本文链接:https://www.haomeiwen.com/subject/kqhjqttx.html