Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to change the dropdown height in spinner

i tried a lot to change the dropdown item height of spinner.. but i couldn't get a good solution.. plz help me guys..

here is a code loginactivityview.xml

       <Spinner
         android:id="@+id/spinnerFacility"
         android:layout_width="400dip"
         android:layout_height="50dip"
         android:layout_alignLeft="@+id/lpassword"
         android:layout_below="@+id/lpassword"
         android:layout_marginTop="32dip"            
         android:background="@drawable/location" 
         android:paddingLeft="10dip"               
         android:dropDownWidth="@style/dropDown"  
         android:minHeight="40dip"     
         android:typeface="monospace" />

loginrowspinner.xml

  <?xml version="1.0" encoding="utf-8"?>
  <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >

  <TextView
    android:id="@+id/textViewRowFacility"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:gravity="left"
    android:paddingBottom="5dip"
    android:paddingLeft="6dip"
    android:paddingRight="6dip"
    android:paddingTop="5dip"
    android:text="Facility"
    android:textColor="#000000"
    android:textSize="20dip" >
</TextView>

enter image description here

how to change the height of drop down any idea..

like image 511
Rao's Avatar asked Oct 13 '12 05:10

Rao's


1 Answers

Just add this to your adapter.

adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
like image 105
John Avatar answered Oct 12 '22 01:10

John