Android: reduce the spinner dropdown width

I have covered most of the questions on this, and there seems to be no definitive answer. I have three spinners in different rows of the table. Using the weight attribute, the cells in the table, and therefore the spinners and text views, are the same width.

However, when the click is clicked, the drop-down list is displayed full width and spans the entire table. There should be a way to limit the width of the list. It contains only a number consisting of a maximum of 4 digits.

I saw a note on R.attr.dropDownWidth that looks like it might help, but I have no idea how to implement this method, not to mention whether it will actually work.

Any help on a particular method that will limit the width of the drop-down list to about 100 dip will be really appreciated - especially if the sample code is included.

Thank,

Alan...

+5
source share
1 answer

However, when the click is clicked, the drop-down list is displayed full width and spans the entire table.

This is because it is really a popup dialog.

There should be a way to limit the width of the list.

, . , , Spinner , Spinner. , Spinner, ( ) performClick(), AlertDialog, , Android?.

, , Spinner Honeycomb, , Ice Cream Sandwich. Honeycomb, clone-the-class .

R.attr.dropDownWidth, , , , , , .

, , . , , , AutoCompleteTextView.

+5

All Articles