从TTStyledTextLabel迁移

问题描述:

我使用Three20框架中的TTStyledTextLabel。我只是简单地将它用于文本标记,如加粗文本。现在我应该从Three20迁移。从TTStyledTextLabel迁移

实现TTStyledTextLabel功能的最简单方法是什么?可能存在TTStyledTextLabel等价物吗?

看看TTTAttributedLabel。它像iOS 6中的UILabel一样工作,但支持iOS 5(甚至可能是iOS 4)。

+0

我试图在Xcode 4.4.1上启动TTTAttributedLabel示例,但有一个编译错误(使用未声明的标识符'NSMutableParagraphStyle')。看起来NSMutableParagraphStyle只能从IOS 6获得。你确定它与IOS 5兼容吗? – Freelander

+0

Mattt回复:更新你的Xcode版本,一切都应该工作得很好。要么是,要么使用TTTAttributedLabel的旧版本。 – Freelander

看看标准UILabel。它支持从iOS 6开始的NSAttributedString

+0

是的,NSAttributedString在这里是很好的解决方案。但我需要支持IOS 5. – Freelander