由网友(弑)分享简介:我的code是这样的:My code looks like this:TextView task_text = (TextView) view.findViewById(R.id.task_text);task_text.setPaintFlags( task_text.getPaintFlags() | Paint...
我的code是这样的:
My code looks like this:
TextView task_text = (TextView) view.findViewById(R.id.task_text);
task_text.setPaintFlags( task_text.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
这会导致渗透作用出现在文本。不过,我想知道如何删除标志一旦设定,以及如何检测的标志设置。
This causes a strike through effect to appear on the text. However, I'd like to know how to remove the flag once set, and how to detect that the flag is set.
我明白这是一个按位运算,但我都试过〜和 - 运营商,无论是工作
I understand this is a bitwise operation, but I've tried both ~ and - operators, neither work.
推荐答案
要删除标记,这应该工作:
To remove a flag, this should work:
task_text.setPaintFlags( task_text.getPaintFlags() & (~ Paint.STRIKE_THRU_TEXT_FLAG));
这意味着将所有的一组标志, Paint.STRIKE_THRU_TEXT_FLAG
的除外。
要检查是否设置标志(编辑:一会儿我忘了这是用java ...):
To check if a flag is set ( for a moment I forgot it is java...):
if ((task_text.getPaintFlags() & Paint.STRIKE_THRU_TEXT_FLAG) > 0)
相关推荐
最新文章