【发布时间】:2015-09-17 02:05:24
【问题描述】:
我正在尝试创建一个full width auto complete text field。
到目前为止,我认为文本字段本身看起来是正确的。问题在于自动完成弹出窗口。它周围有一个非常大胆的阴影,我就是无法摆脱它。
不要误会我的意思,我仍然想要阴影,但是一个微妙的阴影,只在弹出窗口的底部,而不是在它周围(尤其不是在顶部,这真的很奇怪)。
类似这样的:
这是我的样子(抱歉,图片太大):
代码
activity_main.xml:
<AutoCompleteTextView
android:id="@+id/actvSearch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginBottom="8dp"
android:background="@drawable/full_width_input"
android:completionThreshold="1"
android:hint="Search a movie..."
android:textColorHint="#BDBDBD"
android:elevation="0dp"
android:popupBackground="@android:color/white" />
full_width_input.xml:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:top="-1dp" android:right="-1dp" android:left="-1dp">
<shape android:shape="rectangle">
<padding android:bottom="20dp" android:top="20dp" android:left="16dp" android:right="16dp" />
<solid android:color="@android:color/white" />
<stroke android:width="1dp" android:color="#E0E0E0" />
</shape>
</item>
</selector>
【问题讨论】:
标签: android xml material-design autocompletetextview