OnItemSelectedListener() not being called for my spinner

后端 未结 1 1752
隐瞒了意图╮
隐瞒了意图╮ 2021-01-21 14:21

Hi i have a spinner that i have hidden using visibility = gone atribute. i call the spinner list using spinner.performclick() , this works fine except for that when selecting an

相关标签:
1条回答
  • 2021-01-21 14:47

    Leave the visibility for the spinner at INVISIBLE, but set the android:layout_width="0dp" and android:layout_height="0dp"

    That way, the spinner is effectively not in the UI until you call performClick(), then it appears, user makes the choice and the spinner collapses back to 0x0 ... and you get the onItemSelected event.

    0 讨论(0)
提交回复
热议问题