的中間留我想顯示TextView的下方的虛線下劃線,下面是我的代碼Android的虛線下劃線在TextView中
<TextView
android:id="@+id/contact_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="4dp"
android:text="1234567890"
android:background="@drawable/dashed_line"
android:layerType="software"
android:textSize="20dp" />
dashed_line.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="line">
<stroke
android:color="@color/oceanBlue"
android:dashWidth="2dp"
android:dashGap="3dp"
android:width="1dp"/>
</shape>
任何人都可以幫助我下面的虛線到textview?
試圖與drawableBottom也,但沒有用
android:drawableBottom="@drawable/dashed_line"
嘗試此鏈接https://mobikul.com/android-strike-textview/ –
@Srikanth看我的代碼 –
嗨@ ND1010_,Vishva dave的代碼工作,後來也會嘗試你的代碼。謝啦。 –