How can I manage the height of android spinner items?

Posted by rushinge on Stack Overflow See other posts from Stack Overflow or by rushinge
Published on 2010-06-13T18:35:21Z Indexed on 2010/06/13 18:42 UTC
Read the original article Hit count: 647

Filed under:
|
|
|

I have an android spinner that's populated by a list of strings using an ArrayAdapter and it operates fine, however because of the way the spinner is displayed I'm running into a display height problem with the list items.

At first glance it would seem that the ArrayAdapter can use a single layout for displaying options which leads to the problem I'm having. When displaying the current item in the spinner (when the user is not selecting a new item from the list) the spinner pads the text so that the spinner is a reasonable size for clicking on. However when the user taps on it and brings up the list to select a new item, the list items presented are way to small height-wise. If I use an item layout that presents the list items at a reasonable height, then the spinner itself becomes exorbitantly huge due to it's own padding of the list item.

Any ideas on how I can manage the height of these two item display modes so that effectively they display with the same height value instead of the spinner height being larger than the list item display height?

© Stack Overflow or respective owner

Related posts about android

Related posts about height