How to set Spinner default value to null?

后端 未结 10 1659
天命终不由人
天命终不由人 2020-11-29 02:36

I\'m trying to get a Spinner to load up with no selected value. Once the user selects a value it then takes them to another page.

This is proving to be a problem be

10条回答
  •  鱼传尺愫
    2020-11-29 03:01

    is it possible have a spinner that loads with nothing selected

    Only if there is no data. If you have 1+ items in the SpinnerAdapter, the Spinner will always have a selection.

    Spinners are not designed to be command widgets. Users will not expect a selection in a Spinner to start an activity. Please consider using something else, like a ListView or GridView, instead of a Spinner.


    EDIT

    BTW, I forgot to mention -- you can always put an extra entry in your adapter that represents "no selection", and make it the initial selected item in the Spinner.

提交回复
热议问题