2
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:visible="true"
android:shape="line">
<stroke
android:width="1dp"
android:color="#008000"
android:dashWidth="2dp"
android:dashGap="2dp"/>
</shape>
#horizontal_line.xml垂直线不垂直扩张[机器人形状]
<?xml version="1.0" encoding="utf-8"?>
<rotate
android:fromDegrees="90"
android:toDegrees="90"
xmlns:android="http://schemas.android.com/apk/res/android"
android:drawable="@drawable/horizontal_line"
>
</rotate>
#above是垂直线XML
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/dark_red_color">
<View
android:layout_width="50dp"
android:layout_height="310dp"
android:background="@drawable/vertical_line"
>
</View>
</LinearLayout>
我试图用垂直线的以上布局或视图。但垂直线不完全展开到其高度。
我想要的虚线......传播vertically.With简单的颜色作为背景/绘制它可以achieved.But它不会产生虚线。 – jily 2015-02-26 10:23:56
@jily查看我的编辑:) – 2015-02-26 11:12:32
通过缩小矩形的宽度...矩形的左右线重叠,所以没有实现完美的垂直虚线。 – jily 2015-02-26 15:01:19