开发者

Dynamic color change in xml?

开发者 https://www.devze.com 2023-03-24 05:54 出处:网络
I have a xml layout, i assigned color like android:textColor=\"#800080\"; is there any way to change the color for this parameter dynamically while the app is running by use开发者_运维百科r input?You

I have a xml layout, i assigned color like android:textColor="#800080"; is there any way to change the color for this parameter dynamically while the app is running by use开发者_运维百科r input?


You can change text color of a view dynamically like this view.setTextColor(Color.parseColor("#234435"));


You can change text color of a view dynamically like this view.setTextColor(Color.rgb(255,0,0));

also view.setTextColor(Color.Red)

0

精彩评论

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