android - Spinner background too big -
our graphic designer sent me png put inside spinners of our app. but, image appears big in phone. resize it, due different screen sizes, don't think nice solution.
i did spinner_selector.xml:
<?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/icono_desplegable_activar" android:state_enabled="true"/> <item android:drawable="@drawable/icono_desplegable" android:state_enabled="false" android:state_window_focused="false"/> </selector>
and, then, in layout:
<spinner android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/textactivity" android:layout_alignparentstart="true" android:id="@+id/spinneractivity" android:background="@drawable/spinner_selector"/>
how can tell spinner not resize according image, resizing image fit spinner?
thank you.
use 9 patch image background of spinner. if can't use 9-patch image, try setting height , width attribute of spinner fixed value.
Comments
Post a Comment