Android share draw dashed lines to display solid line problems on your phone
Original Blog Link: http://wv1124.iteye.com/blog/2187204
Blog Category:
It can be said that this is a bug, it is said that in more than 4.0 machines will appear, I test is Android 4.4.2
XML code
- <? XML version= "1.0" encoding="Utf-8"?>
- <shape xmlns:android="http://schemas.android.com/apk/res/android"
- android:shape="line" >
- <stroke
- android:dashgap="3DP"
- android:dashwidth="8DP"
- android:width="1DP"
- android:color="#999999" />
- <size android:height="1DP" />
- </shape>
Referenced in layout:
XML code
- <View
- android:layout_width="match_parent"
- android:layout_height="3DP"
- android:layout_marginbottom="5DP"
- android:layout_margintop="5DP"
- android:background="@drawable/left_menu_dash_line" />
Displays a solid line on the 4.4.2.
Solve:
XML code
- <View
- android:layertype="Software"
- android:layout_width="match_parent"
- android:layout_height="3DP"
- android:layout_marginbottom="5DP"
- android:layout_margintop="5DP"
- android:background="@drawable/left_menu_dash_line" />
Focus:
XML code
- android:layertype="Software"
You can also:
Java code
- <activity android:name=". Testactivity "android:label=" Test "
- android:hardwareaccelerated="false" >
Focus Off hardware acceleration:
Java code
- android:hardwareaccelerated="false"
Divider_under_pic. Setlayertype(View. Layer_type_software,null);
Use the Setlayertype setting in your code.
Reference:
Http://developer.android.com/guide/topics/graphics/hardware-accel.html
"Turn" Android shape draw dashed line on the phone side to view the problem is solid