Android里TextView加下划线的几种方式
2016-04-18 11:10
671 查看
android里TextView加下划线的几种方式
如果是在资源文件里:<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);//抗锯齿
相关文章推荐
- CSS小例子(只显示下划线的文本框,像文字一样的按钮)
- Android的TextView与Html相结合的具体方法
- Android中实现为TextView添加多个可点击的文本
- 用CSS实现链接的虚线下划线效果
- php把大写命名转换成下划线分割命名
- android textview 显示html方法解析
- Android开发技巧之在a标签或TextView控件中单击链接弹出Activity(自定义动作)
- Android实现TextView中文字链接的4种方式介绍及代码
- android TextView属性的详细介绍 分享
- Android开发实现TextView显示丰富的文本
- Android自定义TextView实现drawableLeft内容居中
- Android重写TextView实现文字整齐排版的方法(附demo源码下载)
- Android TextView实现跑马灯效果的方法
- Android TextView跑马灯效果实现方法
- Android编程设置TextView颜色setTextColor用法实例
- Android实现TextView两端对齐的方法
- Android编程中TextView宽度过大导致Drawable无法居中问题解决方法
- Android TextView显示html样式的文字
- Android TextView字体颜色设置方法小结
- android TextView加下划线的方法