Disabling Spinner in android

后端 未结 4 480
太阳男子
太阳男子 2021-02-03 16:53

I\'m having problems when using android:enabled=\"false\", it\'s not disabling the component in the case it\'s a spinner

4条回答
  •  借酒劲吻你
    2021-02-03 17:39

    It's not possible to enable/disable a Spinner in XML (yet). To do so you have to do it in code.

    Here's an example:

    Spinner spinner = (Spinner) findViewById(R.id.mySpinner);
    spinner.setEnabled(false);
    

提交回复
热议问题