开发者

how to give textcolor to textview in class file

I am creating the custom textview i want to give black textcolor to this textview. how can i set textcolor. my code is

TextView textview = new TextView(this);

textview.setText("Please follow开发者_StackOverflow社区 this Description");

setContentView(_textview);

when i use textview.setTextColor(Integer.parseInt("#000000"))

Thanks in advance


Use Color.parseColor():

textview.setTextColor(Color.parseColor("#000000"));

another option is to use HEX integer directly:

textview.setTextColor(0xff000000);


I found the solution it is done by using the code

textview.setTextColor(Color.BLACK);

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜