Android TextView 添加下劃線的簡單方法
在res的values資源文件夾下,給String.xml文件添加
<string name="userlicense"><u>用戶協(xié)議</u></string>
然后在布局文件TextView控件 屬性中設(shè)置android:text
android:text="@string/userlicense"
需要注意的是,下劃線不會(huì)出現(xiàn)在可視化界面,要在手機(jī)或者模擬器上運(yùn)行才可見
效果:
image

image