"Turn" Android shape draw dashed line on the phone side to view the problem is solid

Source: Internet
Author: User
Tags dashed line

Android share draw dashed lines to display solid line problems on your phone

Original Blog Link: http://wv1124.iteye.com/blog/2187204

Blog Category:
  • Android

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
  1. <? XML version= "1.0" encoding="Utf-8"?>
  2. <shape xmlns:android="http://schemas.android.com/apk/res/android"
  3. android:shape="line" >
  4. <stroke
  5. android:dashgap="3DP"
  6. android:dashwidth="8DP"
  7. android:width="1DP"
  8. android:color="#999999" />
  9. <size android:height="1DP" />
  10. </shape>

Referenced in layout:

XML code
  1. <View
  2. android:layout_width="match_parent"
  3. android:layout_height="3DP"
  4. android:layout_marginbottom="5DP"
  5. android:layout_margintop="5DP"
  6. android:background="@drawable/left_menu_dash_line" />

Displays a solid line on the 4.4.2.

Solve:

XML code
  1. <View
  2. android:layertype="Software"
  3. android:layout_width="match_parent"
  4. android:layout_height="3DP"
  5. android:layout_marginbottom="5DP"
  6. android:layout_margintop="5DP"
  7. android:background="@drawable/left_menu_dash_line" />

Focus:

XML code
    1. android:layertype="Software"

You can also:

Java code
    1. <activity android:name=". Testactivity "android:label=" Test "
    2. android:hardwareaccelerated="false" >

Focus Off hardware acceleration:

Java code
    1. 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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.