YYKit
YYKit copied to clipboard
NSAttributedString setColor:range 后整个字体都会变成设置的颜色
YYTextBinding *binding = [YYTextBinding bindingWithDeleteConfirm:YES]; [mail setTextBinding:binding range:blind]; /// Text binding [mail setColor:[UIColor xm_blueColor] range:blind];
setColor:range 这一刻只会改变 range 内的颜色。
但如果后续又进行 append 字符串,那就可能会附带上前面的属性了,这是 NSMutableAttributedString 的特性。
有什么好的解决办法吗
@MuYanQin @ibireme @mixiu7992 那你们 有什么好的解决方法吗
@MuYanQin 提一嘴 小姐姐真好看
我下班找一下代码吧,之前做的忘记了,不过用笨方法实现了
发自我的iPhone
------------------ 原始邮件 ------------------ 发件人: linqifeng222 [email protected] 发送时间: 2019年6月24日 15:41 收件人: ibireme/YYKit [email protected] 抄送: MuYanQin [email protected], Mention [email protected] 主题: 回复:[ibireme/YYKit] NSAttributedString setColor:range 后整个字体都会变成设置的颜色 (#248)
@MuYanQin @ibireme @mixiu7992 那你们 有什么好的解决方法吗
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
@MuYanQin 我也用了个笨方法 在后面加个空格然后把空格变成白色
好了就行
发自我的iPhone
------------------ 原始邮件 ------------------ 发件人: linqifeng222 [email protected] 发送时间: 2019年6月25日 10:35 收件人: ibireme/YYKit [email protected] 抄送: MuYanQin [email protected], Mention [email protected] 主题: 回复:[ibireme/YYKit] NSAttributedString setColor:range 后整个字体都会变成设置的颜色 (#248)
@MuYanQin 我也用了个笨方法 在后面加个空格然后把空格变成白色
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
@MuYanQin 你用的是什么方法 参考下