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.
Set the Alpha value to 00 (hex) to make any color fully opaque. Set the Alpha value to ff (hex) to make it transparent (the color doesn't matter anymore).
You can actually apply a hex code color that is transparent. The hex code for transparent white (not that the color matters when it is fully transparent) is two zeros followed by white's hex code of FFFFFF or 00FFFFFF.
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With