2
You must use the code below:
TextView tv = (TextView) findViewById(android.R.id.text1);
tv.setPaintFlags(tv.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
That way your text will be crossed out.
2
4
You must use the code below:
TextView tv = (TextView) findViewById(android.R.id.text1);
tv.setPaintFlags(tv.getPaintFlags() | Paint.STRIKE_THRU_TEXT_FLAG);
That way your text will be crossed out.
0
Another solution that works on Views that don’t have Paintflags:
tv.setText(s, TextView.BufferType.SPANNABLE);
Spannable spannable = (Spannable) tv.getText();
spannable.setSpan(new StrikethroughSpan(), 0, s.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
Browser other questions tagged android textview
You are not signed in. Login or sign up in order to post.
perfect! Thank you.
– Wallace Roberto