Modify the Size of an Android Spinner Drop down part Size?

android, spinner

Solution

You can not change the size of spinner as it is default widget. But you can make it custom using background image. Here is my code:

<Spinner 
    android:id="@+id/spinner"
    android:layout_width="fill_parent" 
    android:layout_height="45dp"
    android:drawSelectorOnTop = "true"
    android:layout_marginLeft="20dp"
    android:layout_marginTop="5dp"
    android:layout_marginRight="20dp"
    android:layout_below="@+id/placeCity"
    android:paddingLeft="5dip"
    android:background="@drawable/myspinner_background"
/>
 <ImageView
       android:id="@+id/imageView1"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:layout_alignRight="@+id/spinner"
       android:layout_alignTop="@+id/spinner"
       android:layout_marginRight="5dp"
        android:layout_marginTop="10dp"
       android:src="@drawable/down" />

This is written in XML. And make another file called myspinner_background.xml in drawable folder. Inside that, write this code:

<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<stroke
    android:color="#f269be"
    android:width="2dp" />
<solid
    android:color="#ECC8EC" />

Problem

how can i modify the size of the dropdown part of the spinner?? do i have to do that in XML or in the code itself?

Original source