首页 > 系统 > Android > 正文

android TextView加下划线的方法

2019-10-24 20:41:43
字体:
来源:转载
供稿:网友
这篇文章主要介绍了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>" ));

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