Why does Android button shape changes but not color after applying background drawable (Android, button, Android drawable, development)?
Yes, that's because the Material Design Theme has been applied to your app.
So how do you get of this?
I guess we have two ways to solve this, either you change the material theme or change the button.
Let's see one by one.
- Theme changing
Change the theme from Material to AppCompat theme.
TO
- Change the default view. Like this,
- android:layout_width="wrap_content" android:layout_height="wrap_content"
- android:text="Option A"/>
To
- android:layout_width="wrap_content" android:layout_height="wrap_content"
- android:text="Option A"/>
So yeah that's it. Hope now you got the colors back. Learn More.
Articoli simili
- Why am I not able to make a super chat on YouTube? Why does it say this feature isn’t available yet in your region?
- Why can I move some photos between albums on Facebook but not others?
- How to make the background image of a button disappear when we click it, and make it appear on another button when we click it in Visual Studio
- Why is does the battery draining quickly after the stable update to 9.2 on a Redmi Note 4?