TextView添加上划线

TextView添加下划线

如果是在资源文件里,可以这样写

 

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

 

 

有人说

widget中只能使用前者,后者不可以;activity两种方式都能用。

 

activity我都试过,是两者都可以

但是widget还没有试过。。。