UILabel text Issue in iphone

2019-03-07 06:50发布

I have one label which have a Dynamic string data e.g: "I am Mohit" .I want to make only "am" in bold.Is it Possible in iphone? if yes please give me suggestion.Thanks in advance:)

5条回答
Explosion°爆炸
2楼-- · 2019-03-07 07:09

No you can't have text with different styles in standard UILabel. You need to use NSAttributedString and some custom solution to display them. Check this

查看更多
霸刀☆藐视天下
3楼-- · 2019-03-07 07:15

No you can't have text with different styles in standard UILabel. What you'll probably need to use is NSAttributedString and some custom solution to display them. Check this question for some possible options.

查看更多
在下西门庆
4楼-- · 2019-03-07 07:16

done something like this using three20's TTStyledTextLabel :) it works perfectly

查看更多
欢心
5楼-- · 2019-03-07 07:20

you can use textView instead of label to fulfill your requirement.

ex:-

[textview setContentToHTMLString:@""];

查看更多
Melony?
6楼-- · 2019-03-07 07:31

Not with UILabel. Suggest 2 labels, or subclass. Many related answers, including this.

查看更多
登录 后发表回答