zoukankan      html  css  js  c++  java
  • View组件之各xml属性

    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)]  设置视图可见性

  • 相关阅读:
    idea中如何返回上一个鼠标的焦点
    git-修改本地和远端分支名字
    git修改已经commit的注释记录
    《完全用Linux工作》
    C++ 网络爬虫实现
    计算两个YUV420P像素数据的PSNR---高等算法
    C++类对象大小的计算
    mp4文件格式解析
    BMP图片格式模型(2)
    BMP图片格式模型
  • 原文地址:https://www.cnblogs.com/liujinyao/p/4700478.html
Copyright © 2011-2022 走看看