<!-- 設置文字顏色、大小,陰影 -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="#f00"
android:text="測試"
android:shadowDx="10.0"
android:shadowDy="8.0"
android:shadowRadius="3.0"
android:shadowColor="#00f"
android:textSize="24sp"/>
<!-- 對郵件 電話增加連接 -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="郵件是:[email protected]電話是:18229099596"
android:autoLink="email|phone"/>
autoLink的值:
all 所有
email
map
none
phone
<!-- 設置中間省略號,所有字母大寫 -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="我愛我家別忘了備上它我喜歡82年的Java,you?"
android:ellipsize="middle"
android:textAllCaps="true"/>
ellipsize的值:
middle 中間
end 後面
start 前面
marque 滾動
none 沒有
<!-- 文本類型 -->
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="我愛我家別忘了備上它我喜歡82年的Java,you?"
android.inputType="password"
android:textAllCaps="true"/>
inputType的值:
password
phone
email
number
web……