删除AutoCompleteTextView下拉列表分隔 [英] Remove AutoCompleteTextView dropdown list divider

查看:443
本文介绍了删除AutoCompleteTextView下拉列表分隔的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序,我使用AutoCompleteTextView。 其中一项要求是隐藏的分隔符。 我已经加入AutoCompleteTextView布局:

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

 <AutoCompleteTextView
android:id="@id/address_bar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="15dp"
android:layout_marginRight="8dp"
android:layout_toLeftOf="@id/address_operation_btn"
android:background="@null"
android:completionThreshold="1"
android:dropDownAnchor="@id/anchor"
android:dropDownVerticalOffset="13dp"
android:dropDownWidth="wrap_content"
android:ellipsize="end"
android:gravity="center"
android:layout_centerHorizontal="true"
android:hint="@string/address_bar_hint"
android:imeOptions="actionGo"
android:inputType="textUri"
android:maxLines="1"
android:saveEnabled="true"
android:singleLine="true"
android:dropDownListViewStyle="@style/searchResultsList"
android:textColor="@android:color/white"
android:textColorHint="#80FFFFFF"
android:textSize="17sp" />

我使用的样式

The style i'm using is

    <style name="searchResultsList" parent="@android:style/Widget.ListView">
    <item name="android:divider">@android:color/transparent</item>
    <item name="android:dividerHeight">0px</item>
</style>

但分还是有的... 如何,如果可以隐藏?

But the divider is still there... How if can be hidden?

推荐答案

与应用程序的主题覆盖它。在你的的themes.xml

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>

贷:<一href="http://daniel-$c$cs.blogspot.com/2012/11/styling-autocompletetextview.html">http://daniel-$c$cs.blogspot.com/2012/11/styling-autocompletetextview.html

这篇关于删除AutoCompleteTextView下拉列表分隔的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆