Search code examples
androidbuttonandroid-buttonandroid-attributes

Transparent background for button


I need to set transparent background for my button, but only background, not all button. I've tried:

android:background=""
android:background="null"

and background changed on transparent, but i've got an error:

Error: String types not allowed (at 'background' with value '').

Solution

  • Type of this attribute value should be color, so use buildin attribute for transparent background with color value:

    android:background="@android:color/transparent"