对于EditText,如何不使用Spinner强制用户或接受某些字符串?

问题描述

| 我不想使用微调器,因为它占用了太多空间。 如何限制用户输入字符串数组中包含的文本,例如{\“ Celery \”,\“ Carrot \”,\“ Apple \”}?     

解决方法

        您必须使用列表对话框与微调框类似,但是占用的空间更少。还要使edittext的editable为false。这样它将只接受字符串数组中存在的那些值。     

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...