2

I try to make a spinner which on its first use shows a text like "please select..." in its collapsed state and when it shows the dropdown state, it shows all the items, but nothing is selected. I tried different approaches:

  1. use a list with an extra "please select..." item and try to remove it from the list on first dropdown (the problem is there is no notification when the spinner drops down for the first time)

  2. try to hide the first item in the dropdown view by overriding getDropDownView. But when I set the height of the view at position 0 to 0 pixel, the spinner leaves some extra space at the end of its view, it looks like the size of the view is calculated before getDropDownView is called.

Any other ideas? Thank You!

Gerhard
  • 1,342
  • 2
  • 12
  • 23
  • Rather than setting the height to 0 pixel, maybe try `setVisibility(View.GONE);` – Barak Jun 05 '12 at 13:45
  • I found another very detailed thread on this topic: [link](http://stackoverflow.com/questions/867518/how-to-make-an-android-spinner-with-initial-text-select-one) – Gerhard Jun 05 '12 at 13:58

0 Answers0