Android limit the no of items displayed in a spinner's dropdown list

后端 未结 3 720
感动是毒
感动是毒 2020-12-01 21:34

I have a spinner item bound to an array adapter which might have 0 or more items at any time. I want the spinner dropdown list to only show three items at a time, the rest o

3条回答
  •  甜味超标
    2020-12-01 21:56

    Here's the ultimately simple solution.. just copy this line in Spinner tag...

    android:dropDownHeight="100dp"    
    

    you can also modify width...

    android:dropDownWidth="100dp"   
    

    and you know what it works on AutoCompleteTextView too and with atleast api 16...

提交回复
热议问题