android的一些經常使用屬性的說明

android:alpha 關聯方法: setAlpha(float) 屬性說明: 視圖透明度,值在0-1之間。0爲徹底透明,1爲徹底不透明。android

android:background 關聯方法: setBackgroundResource(int) 屬性說明: 視圖背景git

android:clickable 關聯方法: setClickable(boolean) 屬性說明: 視圖是否可點擊web

android:contentDescription 關聯方法: setContentDescription(CharSequence) 屬性說明: 設置View的備註說明,做爲一種輔助功能提供,爲一些沒有文字描述的View提供說明api

android:drawingCacheQuality 關聯方法: setDrawingCacheQuality(int) 屬性說明: "設置繪圖時半透明質量。有能夠取如下3個值 auto——默認,由框架決定 high——高質量,使用較高的顏色深度,消耗更多的內存 low——低質量,使用較低的顏色深度,可是用更少的內存"app

android:duplicateParentState 關聯方法: 屬性說明: 若是設置此屬性,將直接從父容器中獲取繪圖狀態(光標,按下等)框架

android:fadeScrollbars 關聯方法: setScrollbarFadingEnabled(boolean) 屬性說明: 定義在ScrollBar沒有使用時,是否褪色。ide

android:fadingEdgeLength 關聯方法: getVerticalFadingEdgeLength() 屬性說明: 設置邊框漸變的長度。佈局

android:filterTouchesWhenObscured 關聯方法: setFilterTouchesWhenObscured(boolean) 屬性說明: view所在窗口被其它可見窗口遮住時,是否過濾觸摸事件。測試

android:fitsSystemWindows 關聯方法: setFitsSystemWindows(boolean) 屬性說明: 設置佈局調整時是否考慮系統窗口(如狀態欄)ui

android:focusable 關聯方法: setFocusable(boolean) 屬性說明: 設置是否得到焦點。如有requestFocus()被調用時,後者優先處理。注意在表單中想設置某一個如EditText獲取焦點,光設置這個是不行的,須要將這個EditText前面的focusable都設置爲false才行。在Touch模式下獲取焦點須要設置focusableInTouchMode爲true。

android:focusableInTouchMode 關聯方法: setFocusableInTouchMode(boolean) 屬性說明: 設置在Touch模式下View是否能取得焦點。

android:hapticFeedbackEnabled 關聯方法: setHapticFeedbackEnabled(boolean) 屬性說明: 是否啓用觸摸反饋,啓用後就是在點擊等操做時會有震動等反饋效果

android:id 關聯方法: setId(int) 屬性說明: 給當前View設置一個在當前layout.xml中的惟一編號,能夠經過調用View.findViewById() 或Activity.findViewById()根據這個編號查找到對應的View。不一樣的layout.xml之間定義相同的id不會衝突。

android:importantForAccessibility 關聯方法: setImportantForAccessibility(int) 屬性說明: 設置可達性的重要性

android:isScrollContainer 關聯方法: setScrollContainer(boolean) 屬性說明: 設置當前View爲滾動容器。這裏沒有測試出效果來,ListView/ GridView/ ScrollView根本就不用設置這個屬性,而EdidText設置android:scrollbars也能出滾動條

android:keepScreenOn 關聯方法: setKeepScreenOn(boolean) 屬性說明: 視圖在可見的狀況下是否保持喚醒狀態。

android:layerType 關聯方法: setLayerType(int,Paint) 屬性說明: "設置指定層的類型,能夠取如下3個值: none——不指定 software——軟件層。 hardware——硬件層。使用硬件加速。"

android:layoutDirection 關聯方法: setLayoutDirection(int) 屬性說明: 定義佈局圖紙的方向

android:longClickable 關聯方法: setLongClickable(boolean) 屬性說明: 是否響應長點擊事件

android:minHeight 關聯方法: setMinimumHeight(int) 屬性說明: 設置視圖最小高度

android:minWidth 關聯方法: setMinimumWidth(int) 屬性說明: 設置視圖最小寬度

android:nextFocusDown 關聯方法: setNextFocusDownId(int) 屬性說明: 向下移動焦點時,下一個獲取焦點的view的id

android:nextFocusForward 關聯方法: setNextFocusForwardId(int) 屬性說明: 下一個獲取焦點的view的id

android:nextFocusLeft 關聯方法: setNextFocusLeftId(int) 屬性說明: 向左移動焦點時,下一個獲取焦點的view的id

android:nextFocusRight 關聯方法: setNextFocusRightId(int) 屬性說明: 向右移動焦點時,下一個獲取焦點的view的id

android:nextFocusUp 關聯方法: setNextFocusUpId(int) 屬性說明: 向上移動焦點時,下一個獲取焦點的view的id

android:onClick 關聯方法: 屬性說明: 點擊時,要調用的方法的名稱。

android:padding 關聯方法: setPaddingRelative(int,int,int,int) 屬性說明: 設置上下左右的邊距

android:paddingBottom 關聯方法: setPaddingRelative(int,int,int,int) 屬性說明: 下邊距

android:paddingEnd 關聯方法: setPaddingRelative(int,int,int,int) 屬性說明: 與android:paddingRight相同

android:paddingLeft 關聯方法: setPadding(int,int,int,int) 屬性說明: 左邊距

android:paddingRight 關聯方法: setPadding(int,int,int,int) 屬性說明: 右邊距

android:paddingStart 關聯方法: setPaddingRelative(int,int,int,int) 屬性說明: android:paddingLeft相同

android:paddingTop 關聯方法: setPaddingRelative(int,int,int,int) 屬性說明: 上邊距

android:requiresFadingEdge 關聯方法: setVerticalFadingEdgeEnabled(boolean) 屬性說明: 定義滾動時邊緣是否褪色

android:rotation 關聯方法: setRotation(float) 屬性說明: 旋轉度數

android:rotationX 關聯方法: setRotationX(float) 屬性說明: 水平旋轉度數

android:rotationY 關聯方法: setRotationY(float) 屬性說明: 豎直旋轉度數

android:saveEnabled 關聯方法: setSaveEnabled(boolean) 屬性說明: 在配置改變等狀況出現時是否保存view的狀態數據。若是你的view有id,那默認系統就會幫你保存。

android:scaleX 關聯方法: setScaleX(float) 屬性說明: 水平方向縮放比例

android:scaleY 關聯方法: setScaleY(float) 屬性說明: 豎直方向縮放比例

android:scrollX 關聯方法: 屬性說明: x方向的滾動偏移。即在水平方向滾動了多少距離

android:scrollY 關聯方法: 屬性說明: y方向的滾動偏移。即在豎直方向滾動了多少距離

android:scrollbarAlwaysDrawHorizontalTrack 關聯方法: 屬性說明: 是否老是繪製水平滾動條的滾動軌道

android:scrollbarAlwaysDrawVerticalTrack 關聯方法: 屬性說明: 是否老是繪製豎直滾動條的滾動軌道

android:scrollbarDefaultDelayBeforeFade 關聯方法: setScrollBarDefaultDelayBeforeFade(int) 屬性說明: 滾動條在n毫秒後開始淡出。

android:scrollbarFadeDuration 關聯方法: setScrollBarFadeDuration(int) 屬性說明: 滾動條用多長時間淡出完畢。

android:scrollbarSize 關聯方法: setScrollBarSize(int) 屬性說明: 設置滾動條的尺寸。垂直滾動條的寬度、水平滾動條的高度

android:scrollbarStyle 關聯方法: setScrollBarStyle(int) 屬性說明: "滾動條的風格。共4組值: insideOverlay——內貼圖 insideInset——內插圖 outsideOverlay——外貼圖 outsideInset——外插圖。 inside就是滾動條在繪製在padding之內;outside就是不須要繪製在padding內(即view的邊界處);Overlay是貼圖,就是直接覆蓋在內容的上方,這樣內容可能會顯示到滾動條下方去;Inset是插圖,就是會在對應padding上加上滾動條的寬度,以不讓內容顯示到滾動條下面去。"

android:scrollbarThumbHorizontal 關聯方法: 屬性說明: 水平滾動塊的drawable對象

android:scrollbarThumbVertical 關聯方法: 屬性說明: 豎直滾動塊的drawable對象

android:scrollbarTrackHorizontal 關聯方法: 屬性說明: 水平滾動條滾動軌道的drawable對象

android:scrollbarTrackVertical 關聯方法: 屬性說明: 豎直滾動條滾動軌道的drawable對象

android:scrollbars 關聯方法: 屬性說明: "設置可顯示的滾動條。有3個取值: none——不顯示滾動條 horizontal——顯示水平滾動條 vertical——顯示豎直滾動條"

android:soundEffectsEnabled 關聯方法: setSoundEffectsEnabled(boolean) 屬性說明: 點擊或觸摸該view時,是否須要有聲音效果

android:tag 關聯方法: 屬性說明: string標識。相似id,id是整數標識。

android:textAlignment 關聯方法: setTextAlignment(int) 屬性說明: 設置文本的顯示方式。

android:textDirection 關聯方法: setTextDirection(int) 屬性說明: 設置文本的顯示方向。

android:transformPivotX 關聯方法: setPivotX(float) 屬性說明: 水平方向偏轉量

android:transformPivotY 關聯方法: setPivotY(float) 屬性說明: 豎直方向偏轉量

android:translationX 關聯方法: setTranslationX(float) 屬性說明: 水平方向的移動距離

android:translationY 關聯方法: setTranslationY(float) 屬性說明: 豎直方向的移動距離

android:visibility 關聯方法: setVisibility(int) 屬性說明: "view的可見性。有3個取值: gone——不可見,同時不佔用view的空間; invisible——不可見,但佔用view的空間; visible——可見"

TextView屬性說明

下面對TextView的屬性進行說明 android:autoLink 關聯方法: setAutoLinkMask(int) 屬性說明: 設置是否「當文本爲URL連接/email/電話號碼/map時,文本顯示爲可點擊的連接」。可選值(none/web/email/phone/map/all)

android:autoText 關聯方法: setKeyListener(KeyListener) 屬性說明: 若是設置,將自動執行輸入值的拼寫糾正。此處無效果,在顯示輸入法並輸入的時候起做用。

android:bufferType 關聯方法: setText(CharSequence,TextView.BufferType) 屬性說明: 指定getText()方式取得的文本類別。選項editable 相似於StringBuilder可追加字符,也就是說getText後可調用append方法設置文本內容。

android:capitalize 關聯方法: setKeyListener(KeyListener) 屬性說明: 設置自動大寫屬性。好比設置爲2,自動大寫單詞首字符;設置爲1,自動大寫每句話的首字母等等。

android:cursorVisible 關聯方法: setCursorVisible(boolean) 屬性說明: 設定光標爲顯示/隱藏,默認顯示。

android:digits 關聯方法: setKeyListener(KeyListener) 屬性說明: 設置容許輸入哪些字符。如「1234567890.+-*/%\n()」

android:drawableBottom 關聯方法: setCompoundDrawablesWithIntrinsicBounds(int,int,int,int) 屬性說明: 在text的下方輸出一個drawable。若是指定一個顏色的話會把text的背景設爲該顏色,而且同時和background使用時覆蓋後者。

android:drawableEnd 關聯方法: setCompoundDrawablesRelativeWithIntrinsicBounds(int,int,int,int) 屬性說明: 在文本結尾處顯示drawable對象。它的值能夠是其它資源的引用,好比,"@[+][package:]type:name"或者"?[package:][type:]name";也能夠是顏色值,如"#rgb", "#argb", "#rrggbb", or "#aarrggbb"。

android:drawableLeft 關聯方法: setCompoundDrawablesWithIntrinsicBounds(int,int,int,int) 屬性說明: 在text的左邊輸出一個drawable。

android:drawablePadding 關聯方法: setCompoundDrawablePadding(int) 屬性說明: 設置text與drawable的間隔,與drawableLeft、drawableRight、drawableTop、drawableBottom一塊兒使用,可設置爲負數,單獨使用沒有效果。

android:drawableRight 關聯方法: setCompoundDrawablesWithIntrinsicBounds(int,int,int,int) 屬性說明: 在text的右邊輸出一個drawable。

android:drawableStart 關聯方法: setCompoundDrawablesRelativeWithIntrinsicBounds(int,int,int,int) 屬性說明: 在文本開始處顯示drawable對象。它的值能夠是其它資源的引用,好比,"@[+][package:]type:name"或者"?[package:][type:]name";也能夠是顏色值,如"#rgb", "#argb", "#rrggbb", or "#aarrggbb"。

android:drawableTop 關聯方法: setCompoundDrawablesWithIntrinsicBounds(int,int,int,int) 屬性說明: 在text的正上方輸出一個drawable。

android:editable 關聯方法: 屬性說明: 設置是否可編輯。這裏無效果,在EditView中才有效果。

android:editorExtras 關聯方法: setInputExtras(int) 屬性說明: 設置文本的額外的輸入數據。在EditView中才有效果。

android:ellipsize 關聯方法: setEllipsize(TextUtils.TruncateAt) 屬性說明: 設置當文字過長時,該控件該如何顯示。

相關文章
相關標籤/搜索