Black color comes instead a transparent background for textview in android

android, textview

Solution

You have specified only the stroke of the Shape, but it needs background. It seems that black is default.

Change your button_style.xml shape by adding the solid transparent background:

<shape>
    <stroke
        android:width="2dp"
        android:color="#88C425" />
    <corners android:radius="20dp" />
    <solid android:color="@android:color/transparent" />
</shape>

Problem

The following two pics are a TextView with the following properties in it: ``` <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/button_style" android:text="select password" android:textColor="@color/dif_black"/> ``` and the button_style.xml is ``` <?xml version="1.0" encoding="UTF-8"?> <layer-list > <item> <shape> <stroke android:width="2dp" android:color="#88C425" /> <corners android:radius="20dp" /> </shape> </item> ``` First pic taken from Canvas 2, Second pic taken from Samsung Galaxy Fame . Here is the problem I don't want the black color to be filled inside the textview border(Stroke). You would have noticed in the first pic that the background of the textview is transparent. I want this same in all android devices to be a transparent background.

Original source