Set text of spinner before item is selected

前端 未结 2 1469
醉话见心
醉话见心 2021-02-15 18:47

I have a spinner with three items and I use an XML string-array resource to feed it. When you open an activity the spinner normally shows the first item that\'s in the array lis

2条回答
  •  误落风尘
    2021-02-15 19:01

    To set a default text for the spinner you have to use android:prompt=@string/SelectOne for your spinner Where SelectOne is defined in your string.xml .

    Example :

     
    

提交回复
热议问题