android TextView加下划线的方法
作者:
这篇文章主要介绍了android TextView加下划线的方法,大家可以在项目代码里试试
如果是在资源文件里,可以这样写.
复制代码 代码如下:
< resources >
< string name = "hello" > < u > phone: 1390123456 </ u > </ string >
< string name = "app_name" > MyLink </ string >
</ resources >
复制代码 代码如下:
<resources>
<string name="hello"><u>phone: 1390123456</u></string>
<string name="app_name">MyLink</string>
</resources>
如果是代码这样写
复制代码 代码如下:
TextView textView = (TextView)findViewById(R.id.testView);
textView.setText(Html.fromHtml("<u>" + "hahaha" + "</u>" ));
您可能感兴趣的文章:
- android TextView设置中文字体加粗实现方法
- Android TextView设置背景色与边框的方法详解
- Android编程开发之TextView文字显示和修改方法(附TextView属性介绍)
- Android TextView字体颜色设置方法小结
- android实现上下滚动的TextView
- Android控件系列之TextView使用介绍
- Android编程实现自动调整TextView字体大小以适应文字长度的方法
- Android实现TextView中文字链接的4种方式介绍及代码
- android textview 显示html方法解析
- android Textview文字监控(Textview使用方法)
- Android开发中TextView各种常见使用方法小结