Spinner does not show selected value

后端 未结 25 1430
-上瘾入骨i
-上瘾入骨i 2020-12-03 13:16

I have implemented the spinner by populating the array list through database.I can get and show the array list in my spinner array adapter but if I select the item in spinne

25条回答
  •  长情又很酷
    2020-12-03 14:03

    This happens occasionally, I guess it's a bug but there's a workaround which is funny but just do it,

    In the property bar of the spinner set the background to a different color,

    In your .xml where you have your spinner, set:

    android:background="@android:drawable/spinner_background_material"
    

    run the code it will generate an error saying the background is private

    delete the line of the android:background in the .xml and run the code again,your spinner should work fine showing all the values, if it doesn't take the extra step of setting background tint to a different color preferably black.

    Run it again.

提交回复
热议问题