天天看點

TextView首行縮進換行的問題

在string.xml标簽裡面直接可以用”\u3000\u3000”加上文字,換行\n也可以直接寫到該标簽裡面用。

方式一:這種方式不同分辨率會有問題 

setText(” “+xxxxx); 
           

方式二: 

setText(“\u3000\u3000”+xxxxx); 
           

<TextView
     android:layout_width="match_parent"
     android:layout_height="wrap_content"
     android:text="@string/default_string" />
           
<string name="default_string">\u3000\u3000預設</string>
           

半角:\u0020 

全角:\u3000

繼續閱讀