Always thought that the shape of Android can draw straight lines, dashes, rectangles, circles, etc., Draw straight line also forget, with a view set the height and color, you can come out a straight line. So this is often not used for me, round is OK, see my application in the message prompt box is generated, OK, this does not exist, today want to do is a dashed line, nothing said, directly on the dotted line code:
<?xml version= "1.0" encoding= "Utf-8"? ><shape xmlns:android= "Http://schemas.android.com/apk/res/android" android:shape= line > <!--display 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"/ > <!--dash height- <size android:height= "2DP"/>
Explain the good perfect, really want not not to try, estimate lifetime will believe this is true, the result is put on the cell phone, never appeared what line, for like me the pursuit of perfect people, nature will not let this a detail, in the Internet to find the majority of days, some small partners have also met, and also solved, But to take their methods to get over, are not a well, the actual situation is still can not be shown, summed up the solution of the small partners
1. Since android3.0, Android has turned off hardware acceleration so it cannot be displayed, so it is possible to turn off the hardware-accelerated function in Androidmanifest.xml, or in the activity: Hardwareaccelerated= "false" or view.setlayertype (View.layer_type_software, NULL);
2. A small partner of the translation, said what height to be greater than dashwidth to display.
I tried it their way, and I couldn't do it at all.
So if you want to make a real realization, just go ahead and draw a dashed line yourself.
Android uses shape to draw dashed lines, and how not to show