draw line through text in textview

后端 未结 2 683
鱼传尺愫
鱼传尺愫 2021-02-07 04:09

I have started to make an application similar to concept of \"To do task manager\", in which i need to make a textview cancelable, like, when user clicks on done image, whole te

相关标签:
2条回答
  • 2021-02-07 04:26

    In Kotlin

    tv.text = "This is text"
    tv.paintFlags = tv.paintFlags or Paint.STRIKE_THRU_TEXT_FLAG
    
    0 讨论(0)
  • 2021-02-07 04:31

    This can help you.

        TextView tv = (TextView) findViewById(R.id.mytext);
        tv.setText("This is strike-thru");
        tv.setPaintFlags(tv.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
    

    You can use it in your code,however necessary.

    0 讨论(0)
提交回复
热议问题