UITextView富文本? [英] UITextView Rich text?

查看:181
本文介绍了UITextView富文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道UITextView是否可以显示富文本?我想在我的只读文本上进行简单的格式化(比如文本不同部分的不同对齐方式)。如果没有,我应该使用什么视图?

I was wondering if UITextView can display rich text? I want to have simple formatting on my read only text (like different alignment for different parts of the text). if not, what view should I use?

推荐答案

通常,最好的方法是使用UIWebView并加载本地您可以在其中插入标签的内容以及您需要的任何其他内容。本地加载应该很快,您可以将其样式化为任何uitextview

Generally, the best way to do this is to use a UIWebView and load local content in where you can insert tags and whatever else you need. Local loading should be fast and you can stylize it to look like any uitextview

另一种选择是使用UILabel子类而获取 Three20 open-souce code。你想要 TTStyledTextLabel

Another option is to use a UILabel subclass instead and get the Three20 open-souce code. You want the TTStyledTextLabel.

这篇关于UITextView富文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆