简体   繁体   English

水平检查线android textview

[英]Horizontal checked line android textview

This might be a simple question but I am not able to find a solution after hours of search. 这可能是一个简单的问题,但经过数小时的搜索后我找不到解决方案。 How to achieve Strikethrough effect on the TextView given in the image below. 如何在下图中给出的TextView上实现删除线效果。 The line length should be same as the text length. 行长应与文本长度相同。

在此处输入图片说明

TextView textview = (TextView) findViewById(R.id.textview);
textview.setPaintFlags(textview.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
textview.setText(someString);

Make sure your textview width is WRAP_CONTENT. 确保您的textview宽度为WRAP_CONTENT。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM