1. The dashed drawing effect can be done using the XML in Android.
2. Directly on the code:
<relativelayout android:id= "@+id/coupon_popup" android:layout_width= "320DP" android:layout_ height= "200DP" android:layout_margin= "20DP" android:gravity= "center_vertical" android:background= " @drawable/bg_border_stroke ">
Write a bg_border_stroke XML to do the background.
Bg_border_stroke.xml
<?xml version= "1.0" encoding= "Utf-8"? ><layer-list xmlns:android= "http://schemas.android.com/apk/res/ Android > <item> <shape> <stroke android:width= "1DP" android:color= "# e8a227 "/> <solid android:color=" #FFFFFF "/> <corners android:radius=" 5DP "/> </shape > </item> <item android:bottom= "1DP" android:left= "1DP" android:right= "1DP" android:top= "1DP" > <shape> <stroke android:dashgap= "15DP" android: Dashwidth= "15DP" android:width= "2.5DP" android:color= "#E8A227"/> <solid android:color= "# FFFFFF "/> <corners android:radius=" 5DP "/> </shape> </item></layer-list >
You can achieve the following border effect: