Problem:
As for how to draw the dotted line is not much to say, online everywhere, talk about the development of the problems encountered:
1. starting with Android3.0, the Android 2D drawing process is designed to better support hardware acceleration. Hardware acceleration is used when you use the GPU's view to draw on the canvas. But then when we define the shape to draw the dashed line, we find that the drawing is not a dashed line but an implementation.
At that time the solution was searched, not hesitate to mark it directly on the application attribute
<applicationandroid:hardwareaccelerated= "true" ...>
The problem is that when the hardware acceleration is turned off, the ListView slides on the splash screen. Obviously we can't application the level to turn off hardware acceleration because it might affect the effect of other pages.
Workaround:
Activity level
If your application cannot be application the application level is performing well, you can use the activity for separate control. To start or disable hardware acceleration for a activity , you can use activity Android:hardwareaccelerated the property. One of the following columns makes the entire application enable hardware acceleration, but for a activity disables the use of hardware acceleration.
<application android:hardwareaccelerated= "true" > <activity .../> <activity android: Hardwareaccelerated= "false"/></application>
View level
We can disable hardware acceleration for individual View at run time phase. We can use the following code:
Myview.setlayertype (view.layer_type_software, NULL);
Note: Hardware acceleration at the view level is not possible at this stage.
Android dashed drawing, graphics hardware acceleration