代码改变世界

TextView 加下划线

2011-03-08 14:11  cppguy  阅读(546)  评论(0编辑  收藏  举报

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

Xml代码 
  1.    
  2. <resources>  
  3.     <string name="hello"><u>phone: 1390123456</u></string>  
  4.     <string name="app_name">MyLink</string>  
  5. </resources>  
  <resources>     <string name="hello"><u>phone: 1390123456</u></string>     <string name="app_name">MyLink</string> </resources>
 

如果是代码这样写

Java代码 
  1. TextView textView = (TextView)findViewById(R.id.testView);   
  2. textView.setText(Html.fromHtml("<u>"+"hahaha"+"</u>"));