我定義了一個可繪製的形狀,它是一條線。TextView無法設置DrawableLeft(或頂部,右側,底部)與形狀可繪製?
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="line" >
<stroke android:color="#f00" android:width="2dp"/>
</shape>
然後我在TextView的drawableBottom中設置了這個形狀,但它沒有工作。
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:drawableBottom="@drawable/shape_line"
android:drawablePadding="5dip"
android:text="Hello World" />
爲什麼以及如何讓它工作?
你嘗試在你的形狀中爲筆畫設置一個'android:height'屬性嗎? – SlashG
中風沒有'android:height'屬性 – idengpan