How to manage the height of android spinner items?
Yes, the above answer is correct.
It took me forever to find this, because it's wrong in the sdk samples for 2.2 Android. And I had a hard time accepting that.
Here's a snippet from samples/android-12/Spinner/src/com/android/example/spinner/SpinnerActivity.java:
this.mAdapter = ArrayAdapter.createFromResource(this, R.array.Planets, android.R.layout.simple_spinner_dropdown_item);
while it should have android.R.layout.simple_spinner_item
there instead and simple_spinner_dropdown_item
should only be used for the dropdown items. Otherwise the spinner arrow get streched and it draws dropdown selection circle to the display, too.
I've run into this issue myself a while ago, and it turned out that I need to use different layouts for dropdown and display
I have this code:
adapter = new SimpleCursorAdapter(this, android.R.layout.simple_spinner_item, cGroups,
new String[] {
"name", "_id"
}, new int[] {
android.R.id.text1
});
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);