Android EditText Transparent Background
AndroidAndroid EmulatorAndroid WidgetAndroid ManifestAndroid Problem Overview
I want to have a transparent background for Android EditText widget. How is that possible?
Android Solutions
Solution 1 - Android
Try this
android:background="@null"
Solution 2 - Android
android:background="@android:color/transparent"
Solution 3 - Android
You can also set it using java code
myTextView.setBackgroundColor(Color.TRANSPARENT);
Solution 4 - Android
- in xml file you use this property:
android:background="@android:color/transparent"
- and in java file run time in onCreate method use:
edittext.setBackgroundColor(Color.TRANSPARENT);
Solution 5 - Android
Very simple:
android:alpha="0.5"
Solution 6 - Android
Put this property in edittext:
android:background="@null"
Solution 7 - Android
android:background="#00000000"
Solution 8 - Android
You can also do it programitically like this:
TypedValue value= new TypedValue();
getApplicationContext().getTheme().resolveAttribute(android.R.attr.selectableItemBackground, value, true);
myButton.setBackgroundResource(value.resourceId);
Solution 9 - Android
EditText, like any other view/component can be customized in the xml file. You just need to include below attribute in the EditText attributes.
android:background="@null"
Solution 10 - Android
set this in layout will work
android:background="@color/transparent
and add this in colors.xml
<color name="transparent">#00000000</color>
Solution 11 - Android
For XML code use:
android:background="@color/transparent
or
android:background="@null"
For Java code:
myEditText.setBackgroundColor(Color.TRANSPARENT);
Solution 12 - Android
Use translucent theme
<activity android:theme="@android:style/Theme.Translucent">