生活随笔
收集整理的這篇文章主要介紹了
Android TextView全属性
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
android:shadowDx設(shè)置陰影橫向坐標(biāo)開始位置。 android:shadowDy設(shè)置陰影縱向坐標(biāo)開始位置。 android:shadowRadius設(shè)置陰影的半徑。設(shè)置為0.1就變成字體的顏色了,一般設(shè)置為3.0的效果比較好。 android:singleLine設(shè)置單行顯示。如果和layout_width一起使用,當(dāng)文本不能全部顯示時(shí),后面用“…”來(lái)表示。如android:text="test_ singleLine " android:singleLine="true" android:layout_width="20dp"將只顯示“t…”。如果不設(shè)置singleLine或者設(shè)置為false,文本將自動(dòng)換行 android:text設(shè)置顯示文本. android:textSize設(shè)置文字大小,推薦度量單位”sp”,如”15sp” android:textStyle設(shè)置字形[bold(粗體) 0, italic(斜體) 1, bolditalic(又粗又斜) 2] 可以設(shè)置一個(gè)或多個(gè),用“|”隔開 android:typeface設(shè)置文本字體,必須是以下常量值之一:normal 0, sans 1, serif 2, monospace(等寬字體) 3] android:height設(shè)置文本區(qū)域的高度,支持度量單位:px(像素)/dp/sp/in/mm(毫米) android:maxHeight設(shè)置文本區(qū)域的最大高度 android:minHeight設(shè)置文本區(qū)域的最小高度 android:width設(shè)置文本區(qū)域的寬度,支持度量單位:px(像素)/dp/sp/in/mm(毫米),與layout_width的區(qū)別看這里。 android:maxWidth設(shè)置文本區(qū)域的最大寬度 android:minWidth設(shè)置文本區(qū)域的最小寬度 android:textAppearance設(shè)置文字外觀。如“?android:attr/textAppearanceLargeInverse”這里引用的是系統(tǒng)自帶的一個(gè)外觀,?表示系統(tǒng)是否有這種外觀,否則使用默認(rèn)的外觀。 可設(shè)置的值如下: textAppearanceButton/textAppearanceInverse/textAppearanceLarge/textAppearanceLargeInverse/textAppearanceMedium/textAppearanceMediumInverse/textAppearanceSmall/textAppearanceSmallInverse android:textAppearance設(shè)置文字外觀。如“?android:attr/textAppearanceLargeInverse”這里引用的是系統(tǒng)自帶的一個(gè)外觀,?表示系統(tǒng)是否有這種外觀,否則使用默認(rèn)的外觀。 可設(shè)置的值如下: textAppearanceButton、textAppearanceInverse、textAppearanceLarge、 textAppearanceLargeInverse、textAppearanceMedium、textAppearanceMediumInverse
?
?
?
android:inputType參數(shù)類型說(shuō)明
android:inputType="none"--輸入普通字符
android:inputType="text"--輸入普通字符
android:inputType="textCapCharacters"--輸入普通字符
android:inputType="textCapWords"--單詞首字母大小
android:inputType="textCapSentences"--僅第一個(gè)字母大小
android:inputType="textAutoCorrect"--前兩個(gè)自動(dòng)完成
android:inputType="textAutoComplete"--前兩個(gè)自動(dòng)完成
android:inputType="textMultiLine"--多行輸入
android:inputType="textImeMultiLine"--輸入法多行(不一定支持)
android:inputType="textNoSuggestions"--不提示
android:inputType="textUri"--URI格式
android:inputType="textEmailAddress"--電子郵件地址格式
android:inputType="textEmailSubject"--郵件主題格式
android:inputType="textShortMessage"--短消息格式
android:inputType="textLongMessage"--長(zhǎng)消息格式
android:inputType="textPersonName"--人名格式
android:inputType="textPostalAddress"--郵政格式
android:inputType="textPassword"--密碼格式
android:inputType="textVisiblePassword"--密碼可見格式
android:inputType="textWebEditText"--作為網(wǎng)頁(yè)表單的文本格式
android:inputType="textFilter"--文本篩選格式
android:inputType="textPhonetic"--拼音輸入格式
android:inputType="number"--數(shù)字格式
android:inputType="numberSigned"--有符號(hào)數(shù)字格式
android:inputType="numberDecimal"--可以帶小數(shù)點(diǎn)的浮點(diǎn)格式
android:inputType="phone"--撥號(hào)鍵盤
android:inputType="datetime"
android:inputType="date"--日期鍵盤
android:inputType="time"--時(shí)間鍵盤
轉(zhuǎn)載于:https://www.cnblogs.com/ftxe/p/3642784.html
總結(jié)
以上是生活随笔為你收集整理的Android TextView全属性的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。