1, draw dashed lines, solid line:
Set up the Dotted_line_gray.xml file below the Drawable folder.
Android:shape= "line" Can change the shape you want
<?xml version= "1.0" encoding= "Utf-8"?>
<shape xmlns:android= "Http://schemas.android.com/apk/res/android"
Android:shape= "Line" >
<!--displays a dashed line, the width of the broken polyline is Dashwith, the gap between the broken lines is dashgap, and when DASHGAP=0DP is solid--
<stroke android:width= "1DP" android:color= "#D5D5D5"
Android:dashwidth= "2DP" android:dashgap= "3DP"/>
<!--dashed height--
<size android:height= "2DP"/>
</shape>
And then in the XML of the layout:
As a background source for ImageView or linearlayout, it is possible.
<linearlayout
Android:id= "@+id/activity_line"
Android:layout_width= "Fill_parent"
android:layout_height= "Wrap_content"
android:layout_marginleft= "5dip"
android:layout_marginright= "5dip"
android:background= "@drawable/dotted_line_gray"/>
---------
2. Draw rounded rectangles
Set up the Rect_gray.xml file below the Drawable folder.
<?xml version= "1.0" encoding= "Utf-8"?>
<shape xmlns:android= "Http://schemas.android.com/apk/res/android"
Android:shape= "Rectangle" >
<!--fill Color-
<solid android:color= "#FFFFFF" ></solid>
<!--line width, color gray---
<stroke android:width= "1DP" android:color= "#D5D5D5" ></stroke>
<!--corner radius of a rectangle--
<corners android:radius= "0DP"/>
</shape>
And then in the XML of the layout:
As a background source for ImageView or linearlayout, it is possible.
<linearlayout
Android:id= "@+id/activity_myhezu_wantchuzu"
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content"
android:background= "@drawable/myhezu_dottedline_rect_green"
android:orientation= "Horizontal" >
3. Half rounded corners:
<shape xmlns:android= "Http://schemas.android.com/apk/res/android"
Android:shape= "Rectangle" >
<corners android:topleftradius= "16DP" <!--radius of left corner above--
android:toprightradius= "16DP" <!--radius of the right corner above--
android:bottomleftradius= "0DP" <!--radius of left rounded corner
android:bottomrightradius= "0DP"/> <!--radius of right corner
<gradient android:startcolor= "#ffffff"
Android:endcolor= "#ffffff"
Android:angle= "/>"
<stroke android:width= "1DP"
Android:color= "#80000000"/>
</shape>
Android draws dashed, solid lines, rounded rectangles, half rounded corners