【问题标题】:how can I set substring of a NSString as bold in UILabel [duplicate]如何在 UILabel 中将 NSString 的子字符串设置为粗体 [重复]
【发布时间】:2011-09-12 09:40:12
【问题描述】:

可能重复:
Bold & Non-Bold Text In A Single UILabel?

我想知道如何在UILabel 中将NSString 的子字符串设置为粗体?

例如:我在UILabel 中有一个字符串,比如,

*Apply to a bill of $16 or more 

我想把“$16”加粗。

谢谢....

【问题讨论】:

标签: iphone objective-c nsstring uilabel


【解决方案1】:

只需使用TTTAttributedLabel,它就非常适合您的目的。

【讨论】:

    【解决方案2】:

    您也可以UIWebView 在 iPhone 中显示丰富的内容。

    Display Rich Text Using a UIWebView

    【讨论】:

      【解决方案3】:

      你不能。 iOS 4 还不支持 UILabel 中的富文本。

      试试这个帖子中的一些答案:UILabel with basic rich text support

      【讨论】:

        猜你喜欢
        • 2014-09-21
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-06-05
        • 2016-01-16
        • 2018-07-29
        • 2012-12-10
        • 1970-01-01
        相关资源
        最近更新 更多