android:alpha
setAlpha(float) 屬性說明: 視圖透明度,值在0-1之間堪藐。0為完全透明祟滴,1為完全不透明绪钥。
android:background
setBackgroundResource(int) 屬性說明: 視圖背景
android:clickable
setClickable(boolean) 屬性說明: 視圖是否可點(diǎn)擊
android:contentDescription
setContentDescription(CharSequence) 屬性說明: 設(shè)置View的備注說明哩掺,作為一種輔助功能提供,為一些沒有文字描述的View提供說明
android:drawingCacheQuality
setDrawingCacheQuality(int) 屬性說明: "設(shè)置繪圖時半透明質(zhì)量。有可以取以下3個值 auto——默認(rèn)厘擂,由框架決定 high——高質(zhì)量昆淡,使用較高的顏色深度,消耗更多的內(nèi)存 low——低質(zhì)量刽严,使用較低的顏色深度昂灵,但是用更少的內(nèi)存"
android:duplicateParentState
屬性說明: 如果設(shè)置此屬性,將直接從父容器中獲取繪圖狀態(tài)(光標(biāo),按下等)
android:fadeScrollbars
setScrollbarFadingEnabled(boolean) 屬性說明: 定義在ScrollBar沒有使用時眨补,是否褪色管削。
android:fadingEdgeLength
getVerticalFadingEdgeLength() 屬性說明: 設(shè)置邊框漸變的長度。
android:filterTouchesWhenObscured
setFilterTouchesWhenObscured(boolean) 屬性說明: view所在窗口被其它可見窗口遮住時撑螺,是否過濾觸摸事件含思。
android:fitsSystemWindows
setFitsSystemWindows(boolean) 屬性說明: 設(shè)置布局調(diào)整時是否考慮系統(tǒng)窗口(如狀態(tài)欄)
android:focusable
setFocusable(boolean) 屬性說明: 設(shè)置是否獲得焦點(diǎn)。若有requestFocus()被調(diào)用時甘晤,后者優(yōu)先處理含潘。注意在表單中想設(shè)置某一個如EditText獲取焦點(diǎn),光設(shè)置這個是不行的线婚,需要將這個EditText前面的focusable都設(shè)置為false才行遏弱。在Touch模式下獲取焦點(diǎn)需要設(shè)置focusableInTouchMode為true。
android:focusableInTouchMode
setFocusableInTouchMode(boolean) 屬性說明: 設(shè)置在Touch模式下View是否能取得焦點(diǎn)塞弊。
android:hapticFeedbackEnabled
setHapticFeedbackEnabled(boolean) 屬性說明: 是否啟用觸摸反饋漱逸,啟用后就是在點(diǎn)擊等操作時會有震動等反饋效果
android:id
setId(int) 屬性說明: 給當(dāng)前View設(shè)置一個在當(dāng)前l(fā)ayout.xml中的唯一編號,可以通過調(diào)用View.findViewById() 或Activity.findViewById()根據(jù)這個編號查找到對應(yīng)的View居砖。不同的layout.xml之間定義相同的id不會沖突虹脯。
android:importantForAccessibility
setImportantForAccessibility(int) 屬性說明: 設(shè)置可達(dá)性的重要性
android:isScrollContainer
setScrollContainer(boolean) 屬性說明: 設(shè)置當(dāng)前View為滾動容器。這里沒有測試出效果來奏候,ListView/ GridView/ ScrollView根本就不用設(shè)置這個屬性循集,而EdidText設(shè)置android:scrollbars也能出滾動條
android:keepScreenOn
setKeepScreenOn(boolean) 屬性說明: 視圖在可見的情況下是否保持喚醒狀態(tài)。
android:layerType
setLayerType(int,Paint) 屬性說明: "設(shè)置指定層的類型蔗草,可以取以下3個值: none——不指定 software——軟件層咒彤。 hardware——硬件層。使用硬件加速咒精。"
android:layoutDirection
setLayoutDirection(int) 屬性說明: 定義布局圖紙的方向
android:longClickable
setLongClickable(boolean) 屬性說明: 是否響應(yīng)長點(diǎn)擊事件
android:minHeight
setMinimumHeight(int) 屬性說明: 設(shè)置視圖最小高度
android:minWidth
setMinimumWidth(int) 屬性說明: 設(shè)置視圖最小寬度
android:nextFocusDown
setNextFocusDownId(int) 屬性說明: 向下移動焦點(diǎn)時镶柱,下一個獲取焦點(diǎn)的view的id
android:nextFocusForward
setNextFocusForwardId(int) 屬性說明: 下一個獲取焦點(diǎn)的view的id
android:nextFocusLeft
setNextFocusLeftId(int) 屬性說明: 向左移動焦點(diǎn)時,下一個獲取焦點(diǎn)的view的id
android:nextFocusRight
setNextFocusRightId(int) 屬性說明: 向右移動焦點(diǎn)時模叙,下一個獲取焦點(diǎn)的view的id
android:nextFocusUp
setNextFocusUpId(int) 屬性說明: 向上移動焦點(diǎn)時歇拆,下一個獲取焦點(diǎn)的view的id
android:onClick
setOnClick()或 onClick(View view)屬性說明: 點(diǎn)擊時,要調(diào)用的方法的名稱范咨。
android:padding
setPaddingRelative(int,int,int,int) 屬性說明: 設(shè)置上下左右的邊距
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) 屬性說明: 旋轉(zhuǎn)度數(shù)
android:rotationX
setRotationX(float) 屬性說明: 水平旋轉(zhuǎn)度數(shù)
android:rotationY
setRotationY(float) 屬性說明: 豎直旋轉(zhuǎn)度數(shù)
android:saveEnabled
setSaveEnabled(boolean) 屬性說明: 在配置改變等情況出現(xiàn)時是否保存view的狀態(tài)數(shù)據(jù)故觅。如果你的view有id,那默認(rèn)系統(tǒng)就會幫你保存渠啊。
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) 屬性說明: 設(shè)置滾動條的尺寸拄氯。垂直滾動條的寬度、水平滾動條的高度
android:scrollbarStyle
setScrollBarStyle(int) 屬性說明: "滾動條的風(fēng)格它浅。共4組值: insideOverlay——內(nèi)貼圖 insideInset——內(nèi)插圖 outsideOverlay——外貼圖 outsideInset——外插圖译柏。 inside就是滾動條在繪制在padding以內(nèi);outside就是不需要繪制在padding內(nèi)(即view的邊界處)罚缕;Overlay是貼圖艇纺,就是直接覆蓋在內(nèi)容的上方,這樣內(nèi)容可能會顯示到滾動條下方去邮弹;Inset是插圖,就是會在對應(yīng)padding上加上滾動條的寬度蚓聘,以不讓內(nèi)容顯示到滾動條下面去腌乡。"
android:scrollbarThumbHorizontal
屬性說明: 水平滾動塊的drawable對象
android:scrollbarThumbVertical
屬性說明: 豎直滾動塊的drawable對象
android:scrollbarTrackHorizontal
屬性說明: 水平滾動條滾動軌道的drawable對象
android:scrollbarTrackVertical
屬性說明: 豎直滾動條滾動軌道的drawable對象
android:scrollbars
屬性說明: "設(shè)置可顯示的滾動條。有3個取值: none——不顯示滾動條 horizontal——顯示水平滾動條 vertical——顯示豎直滾動條"
android:soundEffectsEnabled
setSoundEffectsEnabled(boolean) 屬性說明: 點(diǎn)擊或觸摸該view時夜牡,是否需要有聲音效果
android:tag
屬性說明: string標(biāo)識与纽。類似id,id是整數(shù)標(biāo)識塘装。
android:textAlignment
setTextAlignment(int) 屬性說明: 設(shè)置文本的顯示方式急迂。
android:textDirection
setTextDirection(int) 屬性說明: 設(shè)置文本的顯示方向。
android:transformPivotX
setPivotX(float) 屬性說明: 水平方向偏轉(zhuǎn)量
android:transformPivotY
setPivotY(float) 屬性說明: 豎直方向偏轉(zhuǎn)量
android:translationX
setTranslationX(float) 屬性說明: 水平方向的移動距離
android:translationY
setTranslationY(float) 屬性說明: 豎直方向的移動距離
android:visibility
setVisibility(int) 屬性說明: "view的可見性蹦肴。有3個取值: gone——不可見僚碎,同時不占用view的空間; invisible——不可見阴幌,但占用view的空間勺阐; visible——可見"
TextView屬性說明
下面對TextView的屬性進(jìn)行說明 android:autoLink
setAutoLinkMask(int) 屬性說明: 設(shè)置是否“當(dāng)文本為URL鏈接/email/電話號碼/map時,文本顯示為可點(diǎn)擊的鏈接”矛双≡ǔ椋可選值(none/web/email/phone/map/all)
android:autoText
setKeyListener(KeyListener) 屬性說明: 如果設(shè)置,將自動執(zhí)行輸入值的拼寫糾正议忽。此處無效果懒闷,在顯示輸入法并輸入的時候起作用。
android:bufferType
setText(CharSequence,TextView.BufferType) 屬性說明: 指定getText()方式取得的文本類別栈幸。選項(xiàng)editable 類似于StringBuilder可追加字符愤估,也就是說getText后可調(diào)用append方法設(shè)置文本內(nèi)容。
android:capitalize
setKeyListener(KeyListener) 屬性說明: 設(shè)置自動大寫屬性侦镇。比如設(shè)置為2灵疮,自動大寫單詞首字符;設(shè)置為1壳繁,自動大寫每句話的首字母等等震捣。
android:cursorVisible
setCursorVisible(boolean) 屬性說明: 設(shè)定光標(biāo)為顯示/隱藏荔棉,默認(rèn)顯示。
android:digits
setKeyListener(KeyListener) 屬性說明: 設(shè)置允許輸入哪些字符蒿赢。如“1234567890.+-*/%\n()”
android:drawableBottom
setCompoundDrawablesWithIntrinsicBounds(int,int,int,int) 屬性說明: 在text的下方輸出一個drawable润樱。如果指定一個顏色的話會把text的背景設(shè)為該顏色,并且同時和background使用時覆蓋后者羡棵。
android:drawableEnd
setCompoundDrawablesRelativeWithIntrinsicBounds(int,int,int,int) 屬性說明: 在文本結(jié)尾處顯示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) 屬性說明: 設(shè)置text與drawable的間隔,與drawableLeft舶胀、drawableRight概说、drawableTop、drawableBottom一起使用嚣伐,可設(shè)置為負(fù)數(shù)糖赔,單獨(dú)使用沒有效果。
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
屬性說明: 設(shè)置是否可編輯。這里無效果舱呻,在EditView中才有效果醋火。
android:editorExtras
setInputExtras(int) 屬性說明: 設(shè)置文本的額外的輸入數(shù)據(jù)。在EditView中才有效果箱吕。
android:ellipsize
setEllipsize(TextUtils.TruncateAt) 屬性說明: 設(shè)置當(dāng)文字過長時,該控件該如何顯示芥驳。有如下值設(shè)置:”start”—–省略號顯示在開頭;”end”——省略號顯示在結(jié)尾茬高;”middle”—-省略號顯示在中間兆旬;”marquee” ——以跑馬燈的方式顯示(動畫橫向移動)
android:ems
setEms(int) 屬性說明: 設(shè)置TextView的寬度為N個字符的寬度。
android:fontFamily
setTypeface(Typeface) 屬性說明: 文本的字形體系怎栽。
android:freezesText
setFreezesText(boolean) 屬性說明: 設(shè)置保存文本的內(nèi)容以及光標(biāo)的位置丽猬。
android:gravity
setGravity(int) 屬性說明: 設(shè)置文本位置宿饱,如設(shè)置成“center”,文本將居中顯示脚祟。
android:height
setHeight(int) 屬性說明: 設(shè)置文本區(qū)域的高度谬以,支持度量單位:px(像素)/dp/sp/in/mm(毫米)
android:hint
setHint(int) 屬性說明: Text為空時顯示的文字提示信息,可通過textColorHint設(shè)置提示信息的顏色由桌。
android:imeActionId
setImeActionLabel(CharSequence,int) 屬性說明: 設(shè)置IME動作ID为黎。
android:imeActionLabel
setImeActionLabel(CharSequence,int) 屬性說明: 設(shè)置IME動作標(biāo)簽。在EditView再做說明行您。
android:imeOptions
setImeOptions(int) 屬性說明: 附加功能铭乾,設(shè)置右下角IME動作與編輯框相關(guān)的動作,如actionDone右下角將顯示一個“完成”娃循,而不設(shè)置默認(rèn)是一個回車符號片橡。
android:includeFontPadding
setIncludeFontPadding(boolean) 屬性說明: 設(shè)置文本是否包含頂部和底部額外空白,默認(rèn)為true淮野。
android:inputMethod
setKeyListener(KeyListener) 屬性說明: 為文本指定輸入法,需要完全限定名(完整的包名)吹泡。例如:com.google.android.inputmethod.pinyin骤星,但是這里報錯找不到。
android:inputType
setRawInputType(int) 屬性說明: 設(shè)置文本的類型爆哑,用于幫助輸入法顯示合適的鍵盤類型洞难。在EditView中再詳細(xì)說明,這里無效果揭朝。
android:lineSpacingExtra
setLineSpacing(float,float) 屬性說明: 設(shè)置行間距队贱。
android:lineSpacingMultiplier
setLineSpacing(float,float) 屬性說明: 設(shè)置行間距的倍數(shù)。如”1.2”
android:lines
setLines(int) 屬性說明: 設(shè)置文本的行數(shù)潭袱,設(shè)置兩行就顯示兩行柱嫌,即使第二行沒有數(shù)據(jù)。
android:linksClickable
setLinksClickable(boolean) 屬性說明: 設(shè)置鏈接是否點(diǎn)擊連接屯换,即使設(shè)置了autoLink编丘。
android:marqueeRepeatLimit
setMarqueeRepeatLimit(int) 屬性說明: 在ellipsize指定marquee的情況下,設(shè)置重復(fù)滾動的次數(shù)彤悔,當(dāng)設(shè)置為marquee_forever時表示無限次嘉抓。
android:maxEms
setMaxEms(int) 屬性說明: 設(shè)置TextView的寬度為最長為N個字符的寬度。與ems同時使用時覆蓋ems選項(xiàng)晕窑。
android:maxHeight
setMaxHeight(int) 屬性說明: 設(shè)置文本區(qū)域的最大高度
android:maxLength
setFilters(InputFilter) 屬性說明: 限制顯示的文本長度抑片,超出部分不顯示。
android:maxLines
setMaxLines(int) 屬性說明: 設(shè)置文本的最大顯示行數(shù)杨赤,與width或者layout_width結(jié)合使用敞斋,超出部分自動換行截汪,超出行數(shù)將不顯示。
android:maxWidth
setMaxWidth(int) 屬性說明: 設(shè)置文本區(qū)域的最大寬度
android:minEms
setMinEms(int) 屬性說明: 設(shè)置TextView的寬度為最短為N個字符的寬度渺尘。與ems同時使用時覆蓋ems選項(xiàng)挫鸽。
android:minHeight
setMinHeight(int) 屬性說明: 設(shè)置文本區(qū)域的最小高度
android:minLines
setMinLines(int) 屬性說明: 設(shè)置文本的最小行數(shù),與lines類似鸥跟。
android:minWidth
setMinWidth(int) 屬性說明: 設(shè)置文本區(qū)域的最小寬度
android:numeric
setKeyListener(KeyListener) 屬性說明: 如果被設(shè)置丢郊,該TextView有一個數(shù)字輸入法。此處無用医咨,設(shè)置后唯一效果是TextView有點(diǎn)擊效果枫匾,此屬性在EdtiView將詳細(xì)說明。
android:password
setTransformationMethod(TransformationMethod) 屬性說明: 以小點(diǎn)”.”顯示文本
android:phoneNumber
setKeyListener(KeyListener) 屬性說明: 設(shè)置為電話號碼的輸入方式拟淮。
android:privateImeOptions
setPrivateImeOptions(String) 屬性說明: 設(shè)置輸入法選項(xiàng)干茉,在EditText中才有作用。
android:scrollHorizontally
setHorizontallyScrolling(boolean) 屬性說明: 設(shè)置文本超出TextView的寬度的情況下很泊,是否出現(xiàn)橫拉條角虫。
android:selectAllOnFocus
setSelectAllOnFocus(boolean) 屬性說明: 如果文本是可選擇的,讓他獲取焦點(diǎn)而不是將光標(biāo)移動為文本的開始位置或者末尾位置委造。TextView中設(shè)置后無效果戳鹅。
android:shadowColor
setShadowLayer(float,float,float,int) 屬性說明: 指定文本陰影的顏色,需要與shadowRadius一起使用昏兆。
android:shadowDx
setShadowLayer(float,float,float,int) 屬性說明: 設(shè)置陰影橫向坐標(biāo)開始位置枫虏。
android:shadowDy
setShadowLayer(float,float,float,int) 屬性說明: 設(shè)置陰影縱向坐標(biāo)開始位置。
android:shadowRadius
setShadowLayer(float,float,float,int) 屬性說明: 設(shè)置陰影的半徑爬虱。設(shè)置為0.1就變成字體的顏色了隶债,一般設(shè)置為3.0的效果比較好。
android:singleLine
setTransformationMethod(TransformationMethod) 屬性說明: 設(shè)置單行顯示跑筝。如果和layout_width一起使用死讹,當(dāng)文本不能全部顯示時,后面用“…”來表示继蜡。如android:text="test_ singleLine " android:singleLine="true" android:layout_width="20dp"將只顯示“t…”回俐。如果不設(shè)置singleLine或者設(shè)置為false,文本將自動換行
android:text
setText(CharSequence,TextView.BufferType) 屬性說明: 設(shè)置顯示文本.
android:textAllCaps
setAllCaps(boolean) 屬性說明: 設(shè)置文本全為大寫稀并。值為"true"或"false"仅颇。
android:textAppearance
屬性說明: 設(shè)置文字外觀。如“?android:attr/textAppearanceLargeInverse
android:textColor
setTextColor(int) 屬性說明: 設(shè)置文本顏色
android:textColorHighlight
setHighlightColor(int) 屬性說明: 被選中文字的底色碘举,默認(rèn)為藍(lán)色
android:textColorHint
setHintTextColor(int) 屬性說明: 設(shè)置提示信息文字的顏色忘瓦,默認(rèn)為灰色。與hint一起使用。
android:textColorLink
setLinkTextColor(int) 屬性說明: 文字鏈接的顏色.
android:textIsSelectable
isTextSelectable() 屬性說明: 設(shè)置非編輯文本可否被選擇耕皮。值為"true"或"false"境蜕。
android:textScaleX
setTextScaleX(float) 屬性說明: 設(shè)置文字之間間隔,默認(rèn)為1.0f凌停。
android:textSize
setTextSize(int,float) 屬性說明: 設(shè)置文字大小粱年,推薦度量單位”sp”,如”15sp”
android:textStyle
setTypeface(Typeface) 屬性說明: 設(shè)置字形[bold(粗體) 0, italic(斜體) 1, bolditalic(又粗又斜) 2] 可以設(shè)置一個或多個罚拟,用“|”隔開
android:typeface
setTypeface(Typeface) 屬性說明: 設(shè)置文本字體台诗,必須是以下常量值之一:normal 0, sans 1, serif 2, monospace(等寬字體) 3]
android:width
setWidth(int) 屬性說明: 設(shè)置文本區(qū)域的寬度,支持度量單位:px(像素)/dp/sp/in/mm(毫米)赐俗。
android:fadingEdgeLength
設(shè)置淡入淡出邊緣的長度拉队,可以接受大小值的單位是:px、dp阻逮、sp粱快、in、mm叔扼,也可以參考大小值資源
android:fitsSystemWindows
是否適合系統(tǒng)窗體事哭,取值為true或false。該屬性只對不是子組件的組件有效
android:focusable
是否可以獲取焦點(diǎn)瓜富,取值true或false
android:focusableInTouchMode
是否可以在觸摸模式下獲取焦點(diǎn)慷蠕,true或false
android:hapticFeedbackEnabled
是否允許觸摸反饋效果,true或false
android:id
提供該組件的標(biāo)識名食呻,可以借助Activity或View實(shí)例的findViewById方法通過id獲取對應(yīng)的組件實(shí)例對象,其屬性值的形式為:android:id=”@+id/id”
android:isScrollContainer
設(shè)置該組件是否設(shè)置為滾動條容器澎现,true或false
android:keepScreenOn
控制該組件在顯示的時候保持在屏幕顯示仅胞,true或false
android:longClickable
是否響應(yīng)長時間點(diǎn)擊事件,true或false
android:minHeight
組件的最小高度剑辫,取值同android:fadingEdgeLength
android:minWidth
組件的最小寬度干旧,取值同android:fadingEdgeLength
android:nextFocusDown
設(shè)置下一個向下獲取焦點(diǎn)的組件,取值為id
android:nextFocusLeft
設(shè)置下一個向左獲取焦點(diǎn)的組件妹蔽,取值為id
android:nextFocusRight
設(shè)置下一個向右獲取焦點(diǎn)的組件椎眯,取值為id
android:nextFocusUp
設(shè)置下一個向上獲取焦點(diǎn)的組件,取值為id
android:padding
設(shè)置上胳岂、下编整、左、右4個邊緣的填充距離乳丰,必須是一個大小值掌测,取值同android:fadingEdgeLength
android:paddingBottom
設(shè)置下端邊緣的填充距離,取值同android:padding
android:paddingLeft
設(shè)置左端邊緣的填充距離产园,取值同android:padding
android:paddingRight
設(shè)置右端邊緣的填充距離汞斧,取值同android:padding
android:paddingTop
設(shè)置上端邊緣的填充距離夜郁,取值同android:padding
android:saveEnabled
是否允許保存狀態(tài),取值為true或false
android:scrollX
設(shè)置垂直滾動條的位移量粘勒,必須是一個大小值竞端,取值同android:padding
android:scrollY
設(shè)置水平滾動條的位移量,必須是一個大小值庙睡,取值同android:padding
android:scrollbarAlwaysDrawHorizontalTrack
是否總是設(shè)置水平滾動條滑塊事富,true或false
android:scrollbarAlwaysDrawVerticalTrack
是否總是設(shè)置垂直滾動條滑塊,true或false
android:scrollbarSize
設(shè)置垂直滾動條的寬度和水平滾動條的長度埃撵,必須是一個大小值赵颅,取值同android:padding
android:scrollbarStyle
設(shè)置滾動條的樣式,取值為下列之一:
insideOverlay在填充區(qū)域內(nèi)暂刘,覆蓋形式
insideInset在填充區(qū)域內(nèi)饺谬,插進(jìn)形式(凹進(jìn))
outsideOverly在綁定組件邊緣,覆蓋形式
outsideInset在綁定組件邊緣谣拣,插進(jìn)形似
android:scrollbarThumbHorizontal
設(shè)置水平滾動條按鈕的繪制資源募寨,必須引用可繪制資源
android:scrollbarThumbVertical
設(shè)置垂直滾動條按鈕的繪制資源,必須引用可繪制資源
android:scrollbarTrackHorizontal
設(shè)置水平滾動條軌道的繪制資源森缠,必須引用可繪制資源
android:scrollbarTrackVertical
設(shè)置水平滾動條軌道的繪制資源拔鹰,必須引用可繪制資源
android:scrollbars
設(shè)置滾動顯示,可以為一下一個或多個值:
none不顯示滾動條
horizontal只顯示水平滾動條
vertical只顯示垂直滾動條
android:soundEffectsEnabled
是否允許音效贵涵,取值為true或false
android:tag
設(shè)置標(biāo)記內(nèi)容列肢,可以通過View類實(shí)例的getTag方法獲取該組件的標(biāo)記內(nèi)容,或者使用findViewByTag通過標(biāo)記來查找相應(yīng)的子組件
android:visibility
設(shè)置初始化可見狀態(tài)宾茂,取值為以下之一:
visible可見(默認(rèn)值)
invisible不可見(其所占空間將留出)
gone完全不可見(其所占空間都不會留出)
線性布局LinearLayout組件屬性列表
屬性說明
android:baselineAligned
基線對齊
android:baselineAlignedChildIndex
以指定子組件作為基線對齊
android:gravity
指定該物體放入其容器的重心位置瓷马,取值為下列之一:
top上方,物體大小不變
bottom下方跨晴,物體大小不變
left左方欧聘,物體大小不變
right右方,物體大小不變
center_vertical垂直方向的中間端盆,物體大小不變
fill_vertical填滿垂直方向怀骤,自動進(jìn)行大小調(diào)整
center_horizontal水平方向的中間,大小不變
fill_horizontal填滿水平方向焕妙,自動進(jìn)行大小調(diào)整
center居中(既是水平也是垂直方向的中間)
fill填滿整個容器
clip_vertical
clip_horizontal
android:orientation
布局方向蒋伦,取值為下列之一:
horizontal水平的
vertical垂直的(默認(rèn)值)
android:weightSum
組件的比重和
LinearLayout_Layout屬性說明
android:layout_gravity
當(dāng)前子組件的心位置
android:layout_height
當(dāng)前子組件的高度
android:layout_weight
當(dāng)前子組件的空間比重,取值為浮點(diǎn)數(shù)
android:layout_width
當(dāng)前子組件的寬度
RalativeLayout屬性說明
android:gravity
設(shè)置添加組件的重心
android:ignoreGravity
忽略布局重心的影響
RalativeLayout_Layout屬性說明
android:layout_above
將當(dāng)前組件的下邊緣放置于參照組件之上焚鹊,該屬性為參照組件的ID
android:layout_alignBaseline
當(dāng)前組件與參照組件的基線對齊凉敲,該屬性為參照組件的ID
android:layout_alignBottom
當(dāng)前組件與參照組件的下邊界對齊,該屬性為參照組件的ID
android:layout_alignLeft
當(dāng)前組件與參照組件的左邊界對齊,該屬性為參照組件的ID
android:layout_alignParenBottom
當(dāng)前組件與父組件的下邊界對齊爷抓,true或false
android:layout_alignParentLeft
當(dāng)前組件與父組件的左邊界對齊势决,true或false
android:layout_alignParentRight
當(dāng)前組件與父組件的右邊界對齊,true或false
android:layout_alignParentTop
當(dāng)前組件與父組件的上邊界對齊蓝撇,true或false
android:layout_alignRight
當(dāng)前組件與參照組件的右邊界對齊果复,該屬性為參照組件的ID
android:layout_alignTop
當(dāng)前組件與參照組件的上邊界對齊,該屬性為參照組件的ID
android:layout_alignWithParentIfMissing
如果對應(yīng)的兄弟元素找不到的話就以父元素做參照物 true或false
android:layout_below
將當(dāng)前組件的上邊緣放置于參照組件之下渤昌,該屬性為參照組件的ID
android:layout_centerHorizontal
當(dāng)前組件放置到父組件的水平居中的位置
android:layout_centerInParent
當(dāng)前組件放置到父組件的重心位置
android:layout_centerVertical
當(dāng)前組件放置到父組件垂直居中的位置
android:layout_toLeftOf
將當(dāng)前組件的右邊緣放置于參照組件之下虽抄,該屬性為參照組件的ID
android:layout_toRightOf
將當(dāng)前組件的左邊緣放置于參照組件之下,該屬性為參照組件的ID
AbsoluteLayout_Layout屬性說明
android:layout_x
當(dāng)前組件的x坐標(biāo)位置(從左到右方向)
android:layout_y
當(dāng)前組件的y坐標(biāo)位置(從上到下方向)
FrameLayout屬性說明
android:foreground
前置圖片
android:foregroundGravity
前置圖片重心
android:measureAllChildren
在切換顯示時是否側(cè)重所有子組件的大小
android:layout_gravity
添加組件的重心
FrameLayout_Layout屬性說明
android:layout_gravity
當(dāng)前子組件所添加的重心位置
TableLayout屬性說明
android:collapseColumns
設(shè)置允許折疊的列編號独柑,列編號基于0迈窟,屬性值可以是單個或多個列編號,編號與編號直接用逗號”,”分隔
android:shrinkColumns
設(shè)置允許收縮的列編號忌栅,列編號基于0车酣,屬性值可以是單個或多個列編號,編號與編號直接用逗號”,”分隔
android:stretchColumns
設(shè)置允許伸展的列編號索绪,列編號基于0湖员,屬性值可以是單個或多個列編號,編號與編號直接用逗號”,”分隔
TableRow_Cell屬性說明
android:layout_column
設(shè)置該單元格的列編號(基于0)
android:layout_span
指明該單元格可以跨越的列數(shù)
AbsListView屬性說明
android:cacheColorHint
設(shè)置緩沖顏色
android:drawSelectorOnTop
是否將選擇器繪制在備選條目上方瑞驱,取值為true或false
android:fastScrollEnabled
允許快速滾動
android:listSelector
指示選擇器的內(nèi)容
android:scrollingCache
滾動時是否使用繪制緩沖娘摔,true或false
android:smoothScrollbar
平滑滾動條
android:stackFromBottom
從下方堆疊條目
android:textFilterEnbled
是否允許過濾
android:transcriptMode設(shè)置抄本模式
ListView屬性說明
android:choiceMode
選擇模式
android:divider
分割線顏色或組件的參考
android:dividerHeight
分割線高度
android:entries
指定綁定到當(dāng)前列表視圖的一個數(shù)組資源
android:footerDividersEnabled
是否允許頁腳分割線
android:headerDividersEnabled
是否允許頁眉分割線
GridView屬性說明
android:columnWidth
指定列寬
android:gravity
添加組件的重心位置
android:horizontalSpacing
水平空間
android:numColumns
指定列數(shù)
android:strechMode
伸展模式
android:verticalSpacing
垂直空間
Gallery屬性說明
android:animationDuration
動畫持續(xù)時間
android:gravity
添加組件的重心位置
android:spacing
間隔空間
android:unselectedAlpha
非選擇條目的透明度
TextView屬性說明
android:autoLink
是否自動鏈接(內(nèi)容是網(wǎng)址或是電子郵件時)
android:autoText
自動更新拼音錯誤
android:bufferType
設(shè)置緩沖區(qū)類型
android:capitalize
自動大寫
android:cursorVisible
光標(biāo)是否可見,true或false
android:digits
所接受的數(shù)字字符
android:drawableBottom
在文本下方繪制
android:drawableLeft
在文本左方繪制
android: drawablePadding
繪制填充區(qū)
android: drawableRight
在文本右方繪制
android: drawableTop
在文本上方繪制
android:editable
是否可編輯唤反,true或false
android:editorExtras
設(shè)置文本的額外的輸入數(shù)據(jù)凳寺。在EditView中才有效果
android:ellipsize
當(dāng)內(nèi)容過長時會自動打斷單詞內(nèi)容
android:ems
設(shè)置TextView的寬度為N個字符的寬度
android:enabled
是否可用,true或false
android:freezesText
是否凍結(jié)文本
android:gravity
指明文本的重心位置
android:height
高度值
android:hint
指示內(nèi)容
android:imeActionId
設(shè)置IME動作ID
android:imeActionLabel
設(shè)置IME動作標(biāo)簽
android:imeOptions
輸入法選項(xiàng)
android:includeFontPadding
設(shè)置文本是否包含頂部和底部額外空白彤侍,默認(rèn)為true
android:inputMethod
指定輸入法
android:inputType
輸入類型读第,取值為下列之一:
none
text普通文本
textCapCharacters大寫字符
textCapWords單詞首字母大寫
textCapSentences句子首字母大寫
textAutoCorret自動更正
textAutoComplete自動完成
textMultiLine多行內(nèi)容
textUri,Uri
textEmailAddress電子郵件地址
textEmailSubject電子郵件主題
textShortMessage短消息
textLongMessage長消息
textPersonName個人姓名
textPostalAddress郵政地址
textPassword密碼
textVIsiblePassword可見的密碼
textWebEditText網(wǎng)頁格式
textFilter過濾字符串
textPhonetic語言發(fā)音
number數(shù)字
numberSigned有符號數(shù)字
numberDecimal十進(jìn)制數(shù)字
phone電話號碼
datetime日期時間
date日期
time時間
android:lineSpacingExtra
設(shè)置行間距
android:lineSpacingMultiplier
設(shè)置行間距的倍數(shù)
android:lines
設(shè)置文本行數(shù)
android:linksClickable
設(shè)置鏈接是否點(diǎn)擊連接拥刻,即使設(shè)置了autoLick
android:marqueeRepeatLimit
來回移動的動畫次數(shù)
android:maxEms
設(shè)置TextView的寬度為最長為N個字符的寬度。與ems同時使用時覆蓋ems選項(xiàng)
android:maxHeight
物體的最大高度
android:maxLength
最大文本長度
android:maxLines
最大行數(shù)
android:minWidth
物體的最大寬度
android:minEms
設(shè)置TextView的寬度為最短為N個字符的寬度父泳。與ems同時使用時覆蓋ems選項(xiàng)
android:minHeight
物體的最小高度
android:minLines
最小文本行數(shù)
android:minWidth
物體的最小寬度
android:numeric
是否使用數(shù)字輸入方式
android:password
是否使用密碼輸入方式
android:phonenumber
是否使用電話號碼輸入方式
android:privateImeOptions
設(shè)置輸入法選項(xiàng)
android:scrollHorizontally
設(shè)置文本超出TextView的寬度的情況下般哼,是否出現(xiàn)橫拉條
android:selectAllOnFocus
如果文本是可選擇的,讓他獲取焦點(diǎn)而不是將光標(biāo)移動為文本的開始位置或者末尾位置惠窄。TextView中設(shè)置后無效果蒸眠。
android:shadowColor
文本陰影顏色
android:shadowDx
陰影的水平偏移
android:shadowDy
陰影的垂直偏移
android:shadowRadius
陰影的半徑
android:singleLine
是否單行(不自動換行)
android:text
顯示的文本內(nèi)容
android:textApperance
基本字體顏色、字樣杆融、大小和樣式
android:textColor
文本顏色
android: textColorHighlight
文本高亮顏色
android: textColorHint
文本提示顏色
android:textColorLink
文本鏈接顏色
android:textScaleX
文本縮放因數(shù)
android:textSize
文本大小
android:textStyle
文本樣式楞卡,取值為下列之一:
bold粗體
italic斜體
bolditalic粗斜體
android:typeface
字樣
android:width
物體的高度
AutoCompleteTextView屬性說明
android:completionHint
顯示提示
android:completionHintView
提示視圖
android:completionThreshold
設(shè)置開始提示的字符數(shù)
android:dropDownAnchor
下拉框鏈接視圖
android:dropDownSelector
下拉框選擇器
android:dropDownWIdth
下拉框?qū)挾?
ImageView屬性說明
android:adjustViewBounds
是否調(diào)整視圖范圍
android:baselineAlignBottom
是否按照下端基線對齊
android:cropToPadding
是否按照填充進(jìn)行裁剪
android:maxHeight
設(shè)置最大高度
android:maxWidth
設(shè)置最大寬度
android:scaleType
縮放類型,取值為下列之一:
matrix圖片真實(shí)大小
fitXY適合圖片大小
fitStart
fitCenter
fitEnd
center居中顯示
centerCrop
centerInside
android:src
設(shè)置繪制用內(nèi)容
android:tint
設(shè)置染色顏色值
android:layout_above="@id/xxx"
將控件置于給定ID控件之上
android:layout_below="@id/xxx"
將控件置于給定ID控件之下
android:layout_toLeftOf="@id/xxx"
將控件的右邊緣和給定ID控件的左邊緣對齊
android:layout_toRightOf="@id/xxx"
將控件的左邊緣和給定ID控件的右邊緣對齊
android:layout_alignLeft="@id/xxx"
將控件的左邊緣和給定ID控件的左邊緣對齊
android:layout_alignTop="@id/xxx"
將控件的上邊緣和給定ID控件的上邊緣對齊
android:layout_alignRight="@id/xxx"
將控件的右邊緣和給定ID控件的右邊緣對齊
android:layout_alignBottom="@id/xxx"
將控件的底邊緣和給定ID控件的底邊緣對齊
android:layout_alignParentLeft="true"
將控件的左邊緣和父控件的左邊緣對齊
android:layout_alignParentTop="true"
將控件的上邊緣和父控件的上邊緣對齊
android:layout_alignParentRight="true"
將控件的右邊緣和父控件的右邊緣對齊
android:layout_alignParentBottom="true"
將控件的底邊緣和父控件的底邊緣對齊
android:layout_centerInParent="true"
將控件置于父控件的中心位置
android:layout_centerHorizontal="true"
將控件置于水平方向的中心位置
Android 屬性大全
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
- 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來竭讳,“玉大人创葡,你說我怎么就攤上這事【盥” “怎么了灿渴?”我有些...
- 文/不壞的土叔 我叫張陵,是天一觀的道長呐芥。 經(jīng)常有香客問我逻杖,道長,這世上最難降的妖魔是什么思瘟? 我笑而不...
- 正文 為了忘掉前任荸百,我火速辦了婚禮,結(jié)果婚禮上滨攻,老公的妹妹穿的比我還像新娘够话。我一直安慰自己,他們只是感情好光绕,可當(dāng)我...
- 文/花漫 我一把揭開白布女嘲。 她就那樣靜靜地躺著,像睡著了一般诞帐。 火紅的嫁衣襯著肌膚如雪欣尼。 梳的紋絲不亂的頭發(fā)上,一...
- 文/蒼蘭香墨 我猛地睜開眼磺送,長吁一口氣:“原來是場噩夢啊……” “哼驻子!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起估灿,我...
- 序言:老撾萬榮一對情侶失蹤崇呵,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后甲捏,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體演熟,經(jīng)...
- 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
- 正文 我和宋清朗相戀三年司顿,在試婚紗的時候發(fā)現(xiàn)自己被綠了芒粹。 大學(xué)時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
- 正文 年R本政府宣布,位于F島的核電站付材,受9級特大地震影響朦拖,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜厌衔,卻給世界環(huán)境...
- 文/蒙蒙 一璧帝、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧富寿,春花似錦睬隶、人聲如沸。這莊子的主人今日做“春日...
- 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至变勇,卻和暖如春恤左,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背搀绣。 一陣腳步聲響...
- 正文 我出身青樓,卻偏偏與公主長得像物咳,于是被迫代替她去往敵國和親锣险。 傳聞我的和親對象是個殘疾皇子蹄皱,可洞房花燭夜當(dāng)晚...
推薦閱讀更多精彩內(nèi)容
- Android 自定義View的各種姿勢1 Activity的顯示之ViewRootImpl詳解 Activity...
- ¥開啟¥ 【iAPP實(shí)現(xiàn)進(jìn)入界面執(zhí)行逐一顯】 〖2017-08-25 15:22:14〗 《//首先開一個線程,因...
- 出現(xiàn)問題: 點(diǎn)擊mysql 那行的config在my.ini里面把port 3306 改成其他端口就可以了 The...