1. 程式人生 > >Android 對text文字內容新增下劃線

Android 對text文字內容新增下劃線

String.xml檔案內容

<resource>
     <string name="ceshi"><u>underline</u></string> 
</resources> 

Xml佈局檔案應該使用上邊的string資源和下邊的textview屬性,如下所示:

<TextView android:layout_width="wrap_content"
  android:gravity="center_horizontal"
          android:layout_height="wrap_content"
          android:text="@string/my_text"
/>