在textview中通过文字画线 [英] draw line through text in textview

查看:85
本文介绍了在textview中通过文字画线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开始制作类似于执行任务管理器"概念的应用程序,在该应用程序中,我需要取消文本视图,例如,当用户单击完成的图像时,视图中的整个文本都将被取消./p>

有人可以指导我如何实现这种机制吗?

解决方案

这可以为您提供帮助.

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

您可以在代码中使用它,但有必要.

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 text in the view will be cancelled.

Can anyone please guide me on, how to achieve this mechanism ??

解决方案

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.

这篇关于在textview中通过文字画线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆