iOS UITextView下划线距离文字调整教程
///'///'///'//n// 创建一个NSMutableAttributedString对象,并设置文本内容和属性//nNSMutableAttributedString *attributedText = [[NSMutableAttributedString alloc] initWithString:///'Hello, World!///'];//n//n// 设置下划线样式//n[attributedText addAttribute:NSUnderlineStyleAttributeName value:@(NSUnderlineStyleSingle) range:NSMakeRange(0, attributedText.length)];//n//n// 设置下划线距离文字的距离(以点为单位)//n[attributedText addAttribute:NSUnderlineOffsetAttributeName value:@(10) range:NSMakeRange(0, attributedText.length)];//n//n// 将NSAttributedString对象应用到UITextView//ntextView.attributedText = attributedText;//n///'///'///
原文地址: http://www.cveoy.top/t/topic/pKqN 著作权归作者所有。请勿转载和采集!