我是 android 新手,只是一个非常简单的问题,如何在文本视图中添加底线,使其以 1dp 的形式出现在单元格的底部,到目前为止的代码如下:
<?xml version="1.0" encoding="UTF-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="47.5dp"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
android:paddingTop="13dp"
android:background="@drawable/line_str"
android:paddingLeft="8dp"
android:text="@string/manage_categories"
android:singleLine="true"
android:textColor="@color/white"
android:fontFamily="Roboto-Regular"
android:layout_gravity="center"
android:textSize="16sp"
/>
line_str.xml 如下:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- This is the main color -->
<item>
<shape>
<solid android:color="@color/black" />
</shape>
</item>
<!-- This is the line -->
<item android:bottom="1dp">
<shape>
<solid android:color="#252525" />
</shape>
</item>
</layer-list>
任何帮助表示赞赏。谢谢!