0

When I add button widgets it shows purple color, but I want to remove it and change to default white color.
I have terminated all my previous projects and created a new project but still this problem occurs.
What should I do in this matter?

This is a button which I want to change into default white color:

button-example

Yunnosch
  • 26,130
  • 9
  • 42
  • 54
  • Solution here: https://stackoverflow.com/questions/64751455/android-material-button-taking-color-primary-instead-of-color-accent – private static Nov 15 '20 at 08:50

3 Answers3

1

To achieve hive this you must have to change the background color of the button to

android:background ="#FFFFFF"

And the reason may of purple color is that you didn't give it a custom color so android studio set it as color primary which is purple by default.

Ggonstack
  • 31
  • 5
1

i solved that problem by using in attributs --->backgroundTint and put any color you want

or by code=>nameOfButton.setBackgroundColor(Color.anycolor);

1

Also had this problem and I had to just set the background color of my Button.

I think it's caused by the themes.xml and themes.xml (night)

qingy2019
  • 536
  • 7
  • 23