首先,我们先看一下效果
如上图所看到的那样,在“全部提现”加上一个下划线,
那么,我们先来看下我们的TextView控件:
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:autoLink="all"
android:background="@drawable/tomoney_line"
android:text="全部提现"
android:textColor="@color/red_ff"
android:textSize="11dp" />
在这段代码中,我们会看到我们经常用的一个属性:background,没错就是它,像咱们以往的操作一样,创建一个资源文件,附上代码:
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 边框颜色值 -->
<item>
<shape>
<solid android:color="@color/red_ff" /><!--下划线颜色-->
</shape>
</item>
<item android:bottom="1dp"> <!--下划线厚度-->
<shape>
<solid android:color="@color/white" /><!--背景色 不能透明否则会显示上面的下划线颜色-->
</shape>
</item>
</layer-list>
在注释地方,还上自己的需求即可。