android TextView加下劃線的方法
更新時間:2013年11月18日 16:46:17 投稿:zxhpj
這篇文章主要介紹了android TextView加下劃線的方法,大家可以在項目代碼里試試
如果是在資源文件里,可以這樣寫.
復(fù)制代碼 代碼如下:
< resources >
< string name = "hello" > < u > phone: 1390123456 </ u > </ string >
< string name = "app_name" > MyLink </ string >
</ resources >
復(fù)制代碼 代碼如下:
<resources>
<string name="hello"><u>phone: 1390123456</u></string>
<string name="app_name">MyLink</string>
</resources>
如果是代碼這樣寫
復(fù)制代碼 代碼如下:
TextView textView = (TextView)findViewById(R.id.testView);
textView.setText(Html.fromHtml("<u>" + "hahaha" + "</u>" ));
相關(guān)文章
Android 判斷屏幕開關(guān)狀態(tài)方式總結(jié)
這篇文章主要介紹了Android 判斷屏幕開關(guān)狀態(tài)方式總結(jié)的相關(guān)資料,需要的朋友可以參考下2016-10-10
Android ViewPager實現(xiàn)無限循環(huán)效果
這篇文章主要為大家詳細介紹了Android ViewPager實現(xiàn)無限循環(huán)效果的相關(guān)資料,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下2016-03-03

