我已经创建了一条 xml 虚线,如如何在 Android 中制作虚线/虚线?. 如果我将它用作我的 TextView 的背景,它就会显示出来。
<TextView
android:id="@+id/segment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/dotted_lines"
android:gravity="left"
android:text="First segment"
android:textSize="12sp" />
但是,如果我将它用作随附的可绘制对象,它就不会出现。
<TextView
android:id="@+id/segment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:drawableBottom="@drawable/dotted_lines"
android:gravity="left"
android:text="First segment"
android:textSize="12sp" />
本质上,我不在乎这两种方式,除了:我需要虚线出现在 TextView 中的文本下方。请帮忙。