我想用xml绘制垂直虚线,使用shape
。绘制垂直虚线
我用这个例子:
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="line">
<size
android:height="400dp"
android:width="4dp"/>
<stroke
android:color="#000000"
android:dashWidth="100dp"
android:dashGap="10dp" />
</shape>
然后:
<View android:id="@+id/vertical_line"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/dotted_line"
android:layout_marginLeft="27dp"/>
但它不工作。我该怎么做?
<查看机器人:ID = “@ + ID/vertical_line” 机器人:layout_width = “WRAP_CONTENT” 机器人:layout_height = “WRAP_CONTENT” 机器人:背景= “@绘制/ dotted_line” 机器人:layout_marginLeft =“27dp”/> – IgorB
我是这样使用的<但它有些如何绘制在RelativeLayout的中心,我无法理解为什么( – IgorB
要绘制它的位置) –