Android TextView 下划线

实现的方法很简单,这里总结三种:

1
2
textview.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG);
textview .getPaint().setAntiAlias(true);

推荐使用下面的两种

1
textview.setText(Html.fromHtml("<u>" + text+ "</u>")); // 抗锯齿
1
<string name="hello_world"><u>Hello world!</u></string>

猜你喜欢

转载自jianweicao.iteye.com/blog/2039354