Android get color as string value

前端 未结 11 1493
青春惊慌失措
青春惊慌失措 2021-01-30 19:28

If i defined a color in resources


    #123456

it\'s possible

11条回答
  •  醉酒成梦
    2021-01-30 19:46

    This is your answer

    colorStr=getResources().getString(R.color.someColor);
    

    you will get

     colorStr = "#123456"
    

提交回复
热议问题