软件编程
位置:首页>> 软件编程>> Android编程>> android TextView加下划线的方法

android TextView加下划线的方法

  发布时间:2023-09-11 01:12:36 

标签: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>" ));

0
投稿

猜你喜欢

手机版 软件编程 asp之家 www.aspxhome.com