Underline part of a string using NSMutableAttributedString in iOS 8 is not working

后端 未结 7 551
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-13 12:11

I try to underline part of a string, for example, a \'string\' part in \'test string\' string. I\'m using NSMutableAttributedString and my sol

7条回答
  •  再見小時候
    2020-12-13 12:48

    Add color for underline attribute:​​​

    [attributedString addAttribute:NSUnderlineColorAttributeName
                         value:[UIColor redColor]
                         range:NSMakeRange(5, 6)];
    

提交回复
热议问题