android:background - Change the Background Color of an EditText

How to Change the Background Color of an EditText


1. Create an Android project, if you don't already have one.

2. Add an EditText.

3. Open the main.xml file and add the following highlighted line of code between the <EditText> tags.

<EditText
....
android:background="#212121"
/>

4. Determine the Hex value for the color you would like and replace the android:background value with your color.

5. Compile and run!