android, how to draw dotted line in edittext

后端 未结 4 960
悲哀的现实
悲哀的现实 2021-01-19 11:23

I refered to this link: How do I make a dotted/dashed line in Android?, and used DashPathEffect. But this does not work for me? why? my code:

pu         


        
4条回答
  •  借酒劲吻你
    2021-01-19 11:47

    The method setPathEffect is not supported by hardware acceleration. By default it is turned on (I think since Android 4.0)

    http://developer.android.com/guide/topics/graphics/hardware-accel.html#unsupported

    You can turn off hardware acceleration inside the constructor with following code snippet:

    setLayerType(View.LAYER_TYPE_SOFTWARE, null);

提交回复
热议问题