1

TTTAttributedLabel を使用しており、背景色を設定する必要があります。このようにテキストの色を設定できます。

    [mutableAttributedString addAttribute:NSForegroundColorAttributeName
                 value:color
                 range:range];
    self.lblContent.attributedText = mutableAttributedString;

ただし、背景色では機能しません。

    [mutableAttributedString addAttribute:NSBackgroundColorAttributeName
                 value:color
                 range:range];
    self.lblContent.attributedText = mutableAttributedString;

何が間違っているのか分かりますか?

4

1 に答える 1