我有一个 TextView ,我想在它下面显示一行。我正在使用 drawableBottom 属性来执行此操作。这是我的代码
<TextView
android:id="@+id/total"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="right"
android:text="TextView"
android:drawableBottom="@drawable/dividerline"/>
这是我的 dividerline.xml
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="line">
<stroke
android:width="70dp"
android:color="@android:color/black"
/>
<size
android:height="1dp"
/>
<solid
android:color="@android:color/black"
/>
</shape>
我没有收到错误。只是当我运行我的应用程序时, TextView 下方没有出现任何行。
是否对 drawableBottom 属性有误解?期待一些帮助:)
最佳答案
试试这个:
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<size
android:height="1dp"
android:width="70dp" />
<solid android:color="@android:color/black" />
</shape>
关于android - TextView 下方可绘制的线条未显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14394294/