jjzjj

安卓 : Strike out Text with bold or thicker line than default STRIKE_THRU_TEXT_FLAG

coder 2023-12-28 原文

我在罢工文本中使用以下内容。

 viewHolder.price_red.setPaintFlags(viewHolder.price_red
                    .getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);

它的工作原理,但我想增加删除线的大小。

谁能帮我增加线的大小??

最佳答案

您无法更改删除线的粗细。

docs可以看出它只是一面旗帜。打开或关闭。

虽然有几个选项(黑客多于解决方案):

  1. 将文本加粗或描边。这也会自动划线删除线,使其更加明显

  2. 使用drawLine 手动绘制线条。 (虽然这真的很难准确地做到)

关于安卓 : Strike out Text with bold or thicker line than default STRIKE_THRU_TEXT_FLAG,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14120004/

有关安卓 : Strike out Text with bold or thicker line than default STRIKE_THRU_TEXT_FLAG的更多相关文章

随机推荐