android, how to draw dotted line in edittext

后端 未结 4 963
悲哀的现实
悲哀的现实 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:35

    This should work.

    EditText editText=(EditText) v.findViewById(android.R.id.text1);

    editText.setPaintFlags(editText.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);

提交回复
热议问题