Android EditText Transparent Background

I want to have a transparent background for the Android EditText widget. How is this possible?

+59
android android-emulator android-manifest android-widget
Apr 19 '11 at 6:20
source share
11 answers

try it

android:background="@null" 
+125
Apr 19 '11 at 6:24 a.m.
source share
โ€” -
 android:background="@android:color/transparent" 
+37
Jun 08 2018-11-11T00:
source share

You can also install it using java code

 myTextView.setBackgroundColor(Color.TRANSPARENT); 
+9
Jun 23 '12 at 16:29
source share

Very simple:

 android:alpha="0.5" 
+8
Jun 11 '13 at 18:00
source share

Put this property in edittext:

 android:background="@null" 
+2
Oct 07 '13 at
source share
 android:background="#00000000" 
+2
01 Nov '13 at 5:57
source share

You can also do this programmatically as follows:

  TypedValue value= new TypedValue(); getApplicationContext().getTheme().resolveAttribute(android.R.attr.selectableItemBackground, value, true); myButton.setBackgroundResource(value.resourceId); 
+1
Aug 31 '15 at 9:41
source share

EditText, like any other view / component, can be configured in the xml file. You just need to include the attribute below the attributes in the attributes of the EditText.

  android:background="@null" 
+1
Jul 30 '16 at 8:22
source share
  • in the xml file you use this Android property: background = "@ android: color / transparent"
  • and in the java file, the runtime in the onCreate method edittext.setBackgroundColor (Color.TRANSPARENT);
+1
Sep 23 '16 at 12:31 on
source share

set this to the layout will

 android:background="@color/transparent 

and add this to colors.xml

 <color name="transparent">#00000000</color> 
0
Jul 07 '17 at 10:39 on
source share

Use a translucent theme

 <activity android:theme="@android:style/Theme.Translucent"> 
-6
Apr 19 '11 at 6:24 a.m.
source share



All Articles