Android EditText 屬性彙總
設定顯示在空間上的提示資訊 android:numeric="integer" 設定只能輸入整數,如果是小數則是:decimal
android:singleLine="true" 設定單行輸入,一旦設定為true,則文字不會自動換行。
android:password="true" 設定只能輸入密碼
android:textColor = "#ff8c00" 字型顏色
android:textStyle="bold" 字型,bold, italic, bolditalic android:textSize="20dip" 大小
android:capitalize = "characters" 以大寫字母寫
android:textAlign="center" EditText沒有這個屬性,但TextView有 android:textColorHighlight="#cccccc" 被選中文字的底色,預設為藍色
android:textColorHint="#ffff00" 設定提示資訊文字的顏色,預設為灰色 android:textScaleX="1.5" 控制字與字之間的間距
android:typeface="monospace" 字型,normal, sans, serif, monospace android:background="@null" 空間背景,這裡沒有,指透明
android:layout_weight="1" 權重,控制控制元件之間的地位,在控制控制元件顯示的大小時蠻有用的。
android:textAppearance="?android:attr/textAppearanceLargeInverse" 文字外觀,這裡引用的是系統自帶的一個外觀,?表示系統是否有這種外觀,否則使用預設的外觀。不知道這樣理解對不對? 通過EditText的layout xml檔案中的相關屬性來實現:
1. 密碼框屬性 android:password="true" 這條可以讓EditText顯示的內容自動為星號,輸入時內容會在1秒內變成*字樣。
2. 純數字 android:numeric="true" 這條可以讓輸入法自動變為數字輸入鍵盤,同時僅允許0-9的數字輸入
3. 僅允許 android:capitalize="cwj1987" 這樣僅允許接受輸入cwj1987,一般用於密碼驗證 下面是一些擴充套件的風格屬性
android:editable="false" 設定EditText不可編輯
android:singleLine="true" 強制輸入的內容在單行
android:ellipsize="end" 自動隱藏尾部溢位資料,一般用於文字內容過長一行無法全部顯示時
相關文章
- Android開發EditText屬性Android
- css常用屬性彙總CSS
- android — EditText 設定 imeOptions 屬性為何失效?Android
- android -- EditText 設定 imeOptions 屬性為何失效?Android
- Android筆記-3-EditText的屬性介紹Android筆記
- Java程式設計筆記,springboot常用屬性彙總Java程式設計筆記Spring Boot
- Android XML 屬性AndroidXML
- android屬性動畫Android動畫
- android:screenOrientation屬性Android
- Android 《CardView 屬性》AndroidView
- tkinter屬性(總結)
- listview屬性總結View
- Android 系列教程 彙總Android
- android 知識彙總Android
- Android 面試題彙總Android面試題
- Android 屬性動畫(二)Android動畫
- Android 相關屬性Android
- Android屬性之excludeFromRecentsAndroid
- Android自定義屬性Android
- Android介面基本屬性Android
- React屬性用法總結React
- Android屬性動畫詳解(一),屬性動畫基本用法Android動畫
- Android UI美化之 shape的使用及其屬性總結AndroidUI
- 【Android】神奇的android:clipChildren屬性Android
- Android 屬性動畫實戰Android動畫
- Android 動畫之屬性動畫Android動畫
- 如何理解Android屬性動畫Android動畫
- Android之佈局屬性Android
- android佈局屬性大全Android
- CSS屬性總結之backgroundCSS
- android:EditText控制元件Android控制元件
- android EditText 回車事件Android事件
- Android:EditText 多行顯示Android
- Android屬性設定android:noHistory="true"Android
- Android---Android:windowSoftInputMode屬性詳解AndroidWindows
- Android中handler問題彙總Android
- Android 佈局小技巧彙總Android
- Android開源交流分享彙總Android