首页 > 代码库 > andrioid 在textview文字上划一条线

andrioid 在textview文字上划一条线

技术分享

代码如下:

String string = "市场价:¥158.00";

TextView textView = (TextView) findViewById(R.id.textView);

SpannableString sp = new SpannableString(string);

sp.setSpan(new StrikethroughSpan(), 0, string.length(), Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);

textView.setText(sp);

效果如下:

技术分享


andrioid 在textview文字上划一条线