How to make part of a string bold in iOS?

后端 未结 3 2375
栀梦
栀梦 2021-02-20 07:25

I want to make some part of a text string bold.

Eg: This is to be bold. This is normal string.

In Android, it can be easily achieved by using spannable s

3条回答
  •  时光取名叫无心
    2021-02-20 07:50

    You can achieve this using NSMutableAttributedString.

    Refer Apple docs about NSMutableAttributedString.

    I'd tried this answer's code to get bold and normal font in an UILabel.

提交回复
热议问题