0

I have a problem with changing button background image. So i have 2 images (png-24 transparent background). Images are a simple circle and the same circle but with some outerglow ). I have the following code

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/ticketing_row_topup"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@layout/pressed_topup_button"
    android:orientation="horizontal" >

<TextView
    android:id="@+id/topup_name"
    android:layout_width="60dp"
    android:layout_height="fill_parent"
    android:gravity="center_vertical|right"
    android:paddingRight="5dip"
    android:paddingTop="22dip"
    android:text="€"
    android:textColor="@color/black"
    android:textSize="35sp"
    android:textStyle="bold" />

<TextView
    android:id="@+id/topup_display_amount"
    android:layout_width="90dp"
    android:layout_height="match_parent"
    android:gravity="center_vertical|left"
    android:textSize="65sp"
    android:textColor="#0d457f"
    android:textStyle="bold" />
</LinearLayout>

And the pressed_topup_button.xml

 <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android" android:state_enabled="false">
    <item android:state_pressed="true" android:state_enabled="true" android:drawable="@drawable/button_topup_glow" /> 
    <item android:state_focused="true" android:state_enabled="true" android:drawable="@drawable/button_topup" />
    <item android:state_enabled="true" android:drawable="@drawable/button_topup" /> 
</selector>

The LinearLayout is used to populate a GridView in each cell. When i click the cell the behavior is correct (the glow is displayed) but also a yellow color is display on the corner of the image (where suppose to be transparent). How can i fix that? Thanks

tinti
  • 1,455
  • 8
  • 23
  • 39

1 Answers1

0

You need to add

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

to your GridView declaration.

See this: Android: Disable highlighting in GridView

Community
  • 1
  • 1
Ivan Bartsov
  • 19,664
  • 7
  • 61
  • 59