Remove AutoCompleteTextView dropdown list divider

前端 未结 1 943
清歌不尽
清歌不尽 2021-01-19 11:28

In my application, I\'m using AutoCompleteTextView. One of the requirements is to hide the divider. I have added AutoCompleteTextView to layout:

 

        
相关标签:
1条回答
  • 2021-01-19 11:53

    Override it with your application theme. In your themes.xml

    <style name="AppTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar">
      <item name="android:dropDownListViewStyle">@style/DropDownListViewStyle</item>
    </style>
    
    <style name="DropDownListViewStyle" parent="@style/Widget.AppCompat.ListView.DropDown">
      <item name="android:divider">@android:color/transparent</item>
      <item name="android:dividerHeight">0dp</item>
    </style>
    

    Credits to: http://daniel-codes.blogspot.com/2012/11/styling-autocompletetextview.html

    0 讨论(0)
提交回复
热议问题