Android

关注公众号 jb51net

关闭
首页 > 软件编程 > Android > android TextView加下划线

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>" ));

您可能感兴趣的文章:
阅读全文