Change colour of button in Android Studio
As you know, the Default color of the button in the android studio is grey which is not suits for UI. So, here we are going to discuss how to change the colour of the button in android studio using different methods
Table of Contents
Method 1: Using XML
First, add the button in XML layout like this
Normal color of button
After this you will see your button looks something like this
Now you need to add another tag that is android:background=”color Hexa code” like this,
Now, you see your button looks like this
coloured color of button
Method 2: Using a drawable file
This is my best method because it provides you many other operations to perform on the button like rounded corner etc.
Right click on drawable -> new-> drawable resource file and named as background.
Add following line of code there
You see something like this
drawable file
Now, goto your button and drawable like this
coloured button
We update this content as we see more and more methods to change the colour of button in android studio.
How to add button in android studio?
Simply add from the design section of XML layout.
How to change the colour of button in android studio?
Add android:background=”colour” in button
Источник