首页 > 系统 > Android > 正文

android里TextView加下划线的几种方法总结

2019-12-12 04:59:52
字体:
来源:转载
供稿:网友

如果是在资源文件里:

<resources>  <string name="hello"><u>phone:0123456</u></string>  <string name="app_name">MyLink</string></resources>

如果是代码里:

TextView textView = (TextView)findViewById(R.id.tv_test); textView.setText(Html.fromHtml("<u>"+"0123456"+"</u>"));

代码也可以这样:

tvTest.getPaint().setFlags(Paint. UNDERLINE_TEXT_FLAG ); //下划线tvTest.getPaint().setAntiAlias(true);//抗锯齿

以上就是小编为大家带来的android里TextView加下划线的几种方法总结全部内容了,希望大家多多支持武林网~

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表