How should I go about limiting the height of a spinner drop down ?
Suppose for example:
If I have a spinner drop down with total of 10 rows,
I would like to display only the first 3 rows,
and the rest of the content should be scrollable.
How should I go about limiting the height of a spinner drop down ?
Suppose for example:
If I have a spinner drop down with total of 10 rows,
I would like to display only the first 3 rows,
and the rest of the content should be scrollable.
There is no default method in spinner to control number of items to display in drop-down. you can create your own spinner. refer this link, he has created a custom spinner that supports setVisibleItemNo (int no)
method. you can try it. I didn't test it .but the code seems to be working. you can give a try.
/**
* Set the height of DropDown spinner equal to number of visible rows
*
* @param no
* - number (Integer) of visible item row
*/
public void setVisibleItemNo(int no) {
this.visibleItemNo = no;
setListViewHeightBasedOnChildren(lv);
}