私は同じ問題に直面し、多くの方法を試しましたが、結果が得られませんでした。ついに、AutocompleteTextview で分割線と分割線の長さをすばやく簡単に設定できるようになりました。基本的にはArrayAdapter LayoutのTextViewで下側からボーダーを設定できます。のように
ステップ1。次のようにarrayadapetrのレイアウトを作成します
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/testt"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/background_single_line"
android:textColor="@drawable/text_color"
android:textAppearance="?android:attr/textAppearanceMediumInverse"
style="?android:attr/dropDownItemStyle"
android:maxLines="1"
android:padding="3dp"
android:textSize="16sp" />
step2: drawable フォルダーに新しいレイアウトを作成し、その名前は background_single_line.xml
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item>
<shape android:shape="rectangle">
<solid android:color="@android:color/black" />
</shape>
</item>
<item android:bottom="1dp">
<shape android:shape="rectangle">
<solid android:color="@android:color/white" />
</shape>
</item>
最後にディバイダーとして見えます。
