1.如果只是静态显示textView的内容为设置的行间距,执行如下代码:
//textview 改变字体的行间距
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init]
paragraphStyle.lineSpacing = 10// 字体的行间距
NSDictionary *attributes = @{
NSFontAttributeName:[UIFont systemFontOfSize:15],
NSParagraphStyleAttributeName:paragraphStyle
}
textView.attributedText = [[NSAttributedString alloc] initWithString:@"输入你的内容" attributes:attributes]
目前知道的就只能自己设置段落:在String中添加Html标签,用一个TextView就可以实现
text.setText(Html.fromHtml(R.string.test))
按楼主的意思是要实现段落未知,自动分段的话个人认为,内容里应该要有可以识别的标识,不然应该也实现不了。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)