UITextView的一些设置

允许数据监测
[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的一些设置)