Solved. How to set background color without effecting text color (android)? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Solved. How to set background color without effecting text color (android)?

In an android application programing thing I have set the background resource of the view to black and the text color of a text view to white, yet the white text is appearing almost black and therefore nearly invisible. How do I implement background colors in xml android without effecting the other colors? *I know the commanded colors are correct

22nd Dec 2020, 5:20 AM
Cam UOR
Cam UOR - avatar
3 Answers
+ 2
There is an attribute textColor in XML. You can use this attribute to change color of your TextView. Ex: android:textColor="#FFFFFF" // for white
22nd Dec 2020, 5:54 AM
Hardik Sharma
Hardik Sharma - avatar
+ 2
You're welcome 👍
22nd Dec 2020, 5:57 AM
Hardik Sharma
Hardik Sharma - avatar
+ 1
Ah thank you I was using color not textColor now it works
22nd Dec 2020, 5:57 AM
Cam UOR
Cam UOR - avatar