在 AutocompleteTextview 的下拉列表中自定义分隔符/分隔符 [英] Customize divider / separator in dropdown of an AutocompleteTextview
问题描述
我在网站上多次看到有人问过这个问题,但没有人能得到任何答案.
I've seen this question asked some other times on the site, but no one couldn't get any answer.
在android中使用AutocompleteTextview时,有什么方法可以自定义下拉列表中分隔线的外观?
Is there any way to customize the appearance of the divider in the dropdown showing when using an AutocompleteTextview in android?
对于 ListView 来说很容易,但是对于 autocompletetextview 只使用 ArrayAdapter,有什么方法可以自定义分隔符.
It's pretty easy for a ListView, but using only an ArrayAdapter for the autocompletetextview, is there any way to customize the divider.
(不是 textview,我已经知道这样做了)
(Not the textview, I already know doing that)
推荐答案
我不确定如何为单个 AutoCompleteTextView 设置它,但我知道如何为整个应用程序设置它.这也应该对你有帮助:)
Im not sure how you can do it for single AutoCompleteTextView but I know how to set it for the whole application. This should also help you :)
<style name="MyTheme" parent="AppTheme">
<item name="android:dropDownListViewStyle">@style/MyListViewStyle</item>
</style>
<style name="MyListViewStyle" parent="@android:style/Widget.ListView">
<item name="android:divider">#F00</item>
<item name="android:dividerHeight">1px</item>
</style>
这篇关于在 AutocompleteTextview 的下拉列表中自定义分隔符/分隔符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!