我正在使用 AutoCompleteTextView
,当用户点击它时,即使它没有文本,我也想显示建议 - 但 setThreshold(0)
的工作原理完全相同如 setThreshold(1)
- 所以用户必须输入至少 1 个字符才能显示建议。
最佳答案
When
threshold
is less than or equals 0, a threshold of 1 is applied.
您可以通过 showDropDown()
手动显示下拉菜单,因此您可以安排在需要时显示它。或者,子类 AutoCompleteTextView
并覆盖 enoughToFilter()
,始终返回 true
。
关于Android:AutoCompleteTextView 在没有输入文本时显示建议,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2126717/