`
myhpu2008
  • 浏览: 87575 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

TextView 加下划线

阅读更多

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

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>" )); 
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics