Create a Horizontal dotted line in android layout

后端 未结 2 1053
夕颜
夕颜 2020-12-28 11:32

in my layout I am trying to draw a DOTTED LINE.for drawing a horizontal line i am defining a view in my layout file.

     

        
2条回答
  •  感动是毒
    2020-12-28 12:14

    I was pulling my hair on this issue too until I figured out there is a bug in the latest versions of Android when rendering lines like this.

    This bug can be circumvented by adding android:layerType="software" to the view which is using the dotted line as a background.

    Example:

    dotted.xml:

    
    
    
    
    
    
    

    layout.xml:

        
    

提交回复
热议问题