How to get text color of TextView?

前端 未结 4 1029
情歌与酒
情歌与酒 2021-01-31 13:23

In given code lbl[0].getTextColor() is giving Error but i don\'t know how to get text color of textview in java file please help me.

public void angry(View v)
{         


        
4条回答
  •  闹比i
    闹比i (楼主)
    2021-01-31 14:09

    You can get the color code from a TextView.

    int color=tv.getCurrentTextColor();
    String hexColor = String.format("#%06X", (0xFFFFFF & color));
    

提交回复
热议问题