QNA > W > Why Does Android Button Shape Changes But Not Color After Applying Background Drawable (Android, Button, Android Drawable, Development)?

Why does Android button shape changes but not color after applying background drawable (Android, button, Android drawable, development)?

main-qimg-163432e75092cc8f643dbf3e9ce422ae

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.

  1.  

TO

  1.  
  • Change the default view. Like this,
  1. android:layout_width="wrap_content" android:layout_height="wrap_content"  
  2. android:text="Option A"/> 

To

  1. android:layout_width="wrap_content" android:layout_height="wrap_content"  
  2. android:text="Option A"/> 

So yeah that's it. Hope now you got the colors back. Learn More.

Di Harim Sluyter

Perché il mio portatile HP smette di caricarsi a 70? Si ferma lì. A volte si ferma anche al 50%. :: Come può lo schermo del Samsung Galaxy Fold piegarsi senza rompersi?
Link utili