Again ImageButton issues
Posted
by
pedr0
on Stack Overflow
See other posts from Stack Overflow
or by pedr0
Published on 2011-01-13T11:46:11Z
Indexed on
2011/01/13
11:53 UTC
Read the original article
Hit count: 134
Thanks at all for all your help for now.I have another little issues
This is a portion of my layout which give me some problems:
<RelativeLayout android:id="@+id/card_address_layout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="visible"
>
<TextView
style="@style/card_field"
android:id="@+id/card_indirizzo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="left|center_vertical"
android:layout_marginTop="8dp"
android:maxLength="35"
android:ellipsize="marquee"
/>
<ImageButton
android:id="@+id/card_address_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right|center_vertical"
android:layout_toRightOf="@id/card_indirizzo"
android:src="@drawable/map_selector"
android:onClick="startMap"
android:padding="0dp" />
</RelativeLayout>
The image button src is a selector, in this case this one:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" android:drawable="@drawable/map_b" /> <!-- pressed -->
<item android:drawable="@drawable/map_a" /> <!-- default -->
This is the result and I really don't understand why, why the image button has padding??!!!
Help meeeee!
© Stack Overflow or respective owner