How do I make a Spinner's “disabled” state look disabled?

后端 未结 13 1518
傲寒
傲寒 2020-12-09 03:00

When I disable my Spinner it looks almost exactly like it did prior to being disabled, i.e.

Before

13条回答
  •  伪装坚强ぢ
    2020-12-09 03:23

    I found this to be the best solution to the same question that was previously answered by @JSPDeveloper01: https://stackoverflow.com/a/20401876/8041634

    Since Android doesn't gray out the spinner when it has been set to disabled, he suggests creating a custom method that uses the .setAlpha command on the spinner, which grays out the text within it. Brilliant.

提交回复
热议问题