Blog icon indicating copy to clipboard operation
Blog copied to clipboard

Android使用SpannableString美化TextView

Open alwaystest opened this issue 8 years ago • 0 comments

Android使用SpannableString美化TextView

标签(空格分隔): Android


使用方式及效果参见 http://blog.csdn.net/candyguy242/article/details/13509591

在使用的时候发现如果对SpannableString的同一个地方使用两次setSpan,一次使用ClickableSpan添加点击效果,一次使用ForegroundColorSpan设置文字颜色。如果添加点击效果在后面的话,发现前面设置的文字颜色被覆盖掉了。

那么先设置点击效果,再设置文字颜色就可以了。

原因待深入研究SpannableString。

alwaystest avatar Aug 23 '16 12:08 alwaystest