android-autobgbutton icon indicating copy to clipboard operation
android-autobgbutton copied to clipboard

background image dimension broken

Open stefano-gfstudio opened this issue 11 years ago • 4 comments

when i set a background image the width and height are incorrect, but when i use ImageButton are correct the simple code comparison is:

<it.testproj.test.SAutoBgButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="10dp" android:layout_alignParentLeft="true" android:layout_centerVertical="true" android:background="@drawable/btn_web_back" />

    <ImageButton 
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_marginLeft="80dp"
        android:layout_centerVertical="true"
        android:background="@drawable/btn_web_back" />

on left SAutoBgButton and on right ImageButton

screenshot_2013-11-13-10-41-36

it's a bug of your lib or i need to set other params?? thank you

stefano-gfstudio avatar Nov 13 '13 09:11 stefano-gfstudio

It could probably be an implementation difference between Button and ImageButton. I'm not exactly sure. The drawable doesn't really do anything besides setting a color filter and alpha.

shiki avatar Nov 14 '13 02:11 shiki

a ok, but can you solve it?

thank you for answer

stefano-gfstudio avatar Nov 14 '13 07:11 stefano-gfstudio

Will try to look into it if I can. Feel free to make a pull request if you've fixed though.

shiki avatar Nov 20 '13 10:11 shiki

Just a short note on this. A Button extends a TextView where the ImageButton extends an ImageView, so there is a difference in the implementation

JeppeLeth avatar Feb 01 '15 09:02 JeppeLeth