【发布时间】:2016-03-27 07:15:50
【问题描述】:
我想画一条线作为ImageView's背景。但是它不起作用?
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="line">
<solid android:color="#FF0000FF" />
<size android:width="10dp"
android:height="2dp"/>
</shape>
只是一个演示。
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/dividing_line"
android:layout_marginLeft="10dp" />
【问题讨论】:
-
向我们展示您的布局 xml!
-
@NikoYuwono 你可以看我的布局演示
-
尝试将宽度改为 10dp 而不是 wrap_contentn
-
@Egos 显示输出你想要的内容
-
@EgosZhang 之后您是否将图像设置到 ImageView?
标签: android android-drawable android-shapedrawable