android– 使用getCurrentTextColor()设置setTextcolor

android– 使用getCurrentTextColor()设置setTextcolor,第1张

概述我需要从TextView获取当前文本颜色,然后将此值分配给TextView.setTextColor().但是我得到了一个大型的-1979711488138,我怎样才能得到它的颜色?最佳答案Integer intColor = -1979711488138; String hexColor = '#' + Integer.toHexString(intCol

我需要从TextVIEw获取当前文本颜色,然后将此值分配给TextVIEw.setTextcolor().但是我得到了一个大型的-1979711488138,我怎样才能得到它的颜色?最佳答案

Integer intcolor = -1979711488138;String hexcolor = "#" + Integer.toHexString(intcolor).substring(2);

要么

String hexcolor = String.format("#%06X",(0xFFFFFF & intcolor));
总结

以上是内存溢出为你收集整理的android – 使用getCurrentTextColor()设置setTextcolor全部内容,希望文章能够帮你解决android – 使用getCurrentTextColor()设置setTextcolor所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://www.54852.com/web/1149707.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-31
下一篇2022-05-31

发表评论

登录后才能评论

评论列表(0条)

    保存