Casa > 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.

De Terence

Por que o meu laptop HP pára de carregar aos 70? Ele simplesmente pára lá. Às vezes até pára a 50 por cento. :: Devo comprar um Samsung Galaxy Z Flip ou esperar pelo Z Flip 2?