View組件之各xml屬性

來源:互聯網
上載者:User

標籤:

Android中View體系的核心類View類:

不廢話,直接開始中(括弧中為相關的方法):

(1)android:alpha[setAlpha(float)]  設定視圖字型透明度。

(2)android:background[setBackgroundResource(int)]  設定背景圖片。

(3)android:onClick[]   設定單擊事件的響應函數

(4)android:contentDescription[setContentDescription(CharSequence)]  設定視圖內容描述

(5)android:clickable[setClickble(boolean)]  設定視圖是否可點擊

(6)android:drawingCacheQuality[setDrawingCacheQuality(int)] 設定半透明繪圖品質(可選:auto,high,low,記憶體佔用量從高到低)

(7)android:duplicateParentState[]  是否直接從父類獲得繪圖狀態(點擊、焦點)(true或false)

(8)android:fadeScrollbars[setScrollbarFadingEnabled(boolean)]   捲軸不用時,是否隱藏

(9)android:fadingEdgeLength[getVerticalFadingEdgeLength()]  設定邊框漸層的寬度

(10)android:filterTouchesWhenObscured[setFilterTouchesWhenObscured(boolean)]  視圖被遮擋時,是否過濾觸摸事件

(11)android:fitsSystemWindows[setFitsSystemWindows(boolean)]  設定布局調整時是否考慮系統視窗

(12)android:focusable[setFocusable(boolean)]  設定視圖是否為焦點

(13)android:focusableInTouchMode[setFocusableInTouchMode(boolean)]  設定在Touch模式下,視圖是否為焦點

(14)android:hapticFeedbackEnabled[setHapticFeedbackEnable(boolean)]  設定是否接受觸覺反饋事件

(15)android:id[setId(int)]  設定視表徵圖識

(16)android:importantForAccessibility[setImportForAccessibility(int)]

(17)android:isScrollContainer[setScrollContainer(boolean)]  設定是否為滾動容器

(18)android:keepScreenOn[setKeepScreenOn(boolean)]  設定視圖可見時是否為喚醒狀態

(19)android:layerType[setLayerType(int, Paint)]  

(20)android:layoutDirection[setLayoutDirection(int)]  設定布局繪製時的方向(0,1,2,3分為從左至右,從右至左,繼承父類和自適應本地)

(30)android:longClickable[setLongClickable(boolean)]  設定視圖是否相應長按事件

(31)android:minHeight[setMinimumHeight(int)]  設定視圖最小高度

(32)android:minWidth[setMinimumWidth(int)]  設定視圖最小寬度

(33)android:nextFocusDown

(34)android:nextFocusForward

(35)android:nextFocusLeft

(36)android:nextFocusRight

(37)android:nextFocusUp

(38)android:padding[setPaddingRelative(int,int,int,int)] (38)~(44)設定邊距

(39)android:paddingBottom[setPaddingRelative(int,int,int,int)]

(40)android:paddingEnd[setPadding(int,int,int,int)]

(41)android:paddingLeft[setPadding(int,int,int,int)]

(42)android:paddingRight[setPadding(int,int,int,int)]

(43)android:paddingStart[setPaddingRelative(int,int,int,int)]

(44)android:paddingTop[setPaddingRelative(int,int,int,int)]

(45)android:requiresFadingEdge[setVerticalFadingEdgeEnabled(boolean)]  設定是否繪製垂直方向捲軸

(46)android:rotation[setRotation(float)]  旋轉視圖

(47)android:rotationX[setRotationX(float)]   以x軸旋轉視圖

(48)android:rotationY[setRotationY(float)]  以y軸旋轉視圖

(49)andorid:saveEnabled[setSaveEnable(boolean)]  視圖凍結時是否自動儲存狀態

(50)android:scaleX[setScaleX(float)]  設定x方向上的縮放基準點

(51)android:scaleY[setScaleY(float)]  設定y方向上的縮放基準點

(52)android:scrollX

(53)android:scrollY

(54)android:scrollbarAlwaysDrawHorizontalTrack  設定是否始終顯示水平方向的捲軸

(55)android:scrollbarAlwaysDrawVerticalTrack  設定是否始終顯示垂直方向的捲軸

(56)android:scrollbarDefaultDelayBeforeFade[setScrollBarDefaultDelayBeforeFade(int)  設定捲軸N毫秒後淡出(隱藏) 

(57)android:scrollbarFadeDuration[setScrollBarFadeDuration(int)]  設定捲軸淡出方式

(58)android:scrollbarSize[setScrollBarSize(int)]

(59)android:scrollbarStyle[setScrollbarStyle(int)]  設定捲軸的樣式和位置

(60)android:scrollbarThumbHorizontal  設定水平捲軸按下時的背景圖片

(61)android:scrollbarThumbVertical  設定垂直捲軸按下時的背景圖片

(62)android:scrollbarTrackHorizontal  設定水平捲軸滾動時的背景圖片

(63)android:scrollbarTrackVertical  設定垂直捲軸滾動時的背景圖片

(64)android:scrollbars  

(65)android:soundEffectsEnabled[setSoundEffectsEnabled(boolean)]  設定點擊或觸摸時是否有音效

(67)android:tag

(68)android:textAlignment[setTextAlignment(int)]  設定文字對齊

(69)android:textDirection[setTextDirection(int)]  設定文字的繪製方向

(70)android:transformPivotX[setPivotX(float)]  圍繞點x進行旋轉和縮放(以X軸)

(71)android:transformPivotY[setPivotY(float)]  圍繞點x進行旋轉和縮放(以Y軸)

(72)android:translationX[setTranslationX(float)]  

(73)android:translationY[setTranslationY(float)]

(74)android:visibility[setVisibility(int)]  設定視圖可見度

View組件之各xml屬性

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.