android:id —— 为控件指定相应的ID
android:layout_width —— 定义本元素的宽度
android:layout_height —— 定义本元素的高度
android:background —— 指定该控件所使用的背景色,RGB命名法
android:keepScreenOn="true" —— 保持屏幕常亮
android:orientation="vertical" ----horizontal为控件默认横向显示,vertical为竖着显示,不设置该属性默认为横向显示
android:gravity
android:gravity属性是对该view 内容的限定.比如一个button 上面的text. 你可以设置该text 在view的靠左,靠右等位置.以button为例,android:gravity="right"则button上面的文字靠右
android:layout_gravity
android:layout_gravity是用来设置该view相对与起父view 的位置.比如一个button 在linearlayout里,你想把该button放在靠左、靠右等位置就可以通过该属性设置.以button为例,android:layout_gravity="right"则button靠右
------------------------------------属性值为具体的像素值,如30dip,40px,50dp------------------------------------
外间距:
外间距是指控件与控件之间的距离:
android:layout_margin 本元素离父元素上下左右间的距离
android:layout_marginBottom 离父元素底边缘的距离
android:layout_marginLeft 离父元素左边缘的距离
android:layout_marginRight 离父元素右边缘的距离
android:layout_marginTop 离父元素上边缘的距离
android:layout_marginStart本元素里开始的位置的距离(相当于离父元素左边缘的距离)
android:layout_marginEnd本元素里结束位置的距离(相当于离父元素右边缘的距离)
内间距:
内间距是指控件之内的内容与该控件的距离间隔:
android:padding指定布局与子布局的间距
android:paddingLeft指定布局左边与子布局的间距
android:paddingTop指定布局上边与子布局的间距
android:paddingRight指定布局右边与子布局的间距
android:paddingBottom指定布局下边与子布局的间距
android:paddingStart指定布局左边与子布局的间距与android:paddingLeft相同
android:paddingEnd指定布局右边与子布局的间距与android:paddingRight相同
----其它属性
android:fadingEdgeLength 设置边框渐变的长度
android:minHeight最小高度
android:minWidth最小宽度
android:translationX 水平方向的移动距离
android:translationY垂直方向的移动距离
android:transformPivotX相对于一点的水平方向偏转量
android:transformPivotY相对于一点的垂直方向偏转量
------------------------------------End属性值为具体的像素值,如30dip,40px,50dp----------------------------------
------------------------------------关于滚动条的设置----------------------------------
android:fadeScrollbars —— 滚动条自动隐藏
android:scrollbarSize —— 设置滚动条大小
android:scrollbars —— 设置滚动条的状态
android:scrollbarStyle —— 设置滚动条的样式
android:scrollbarFadeDuration —— 设置滚动条淡入淡出时间
android:scrollbarDefaultDelayBeforeFade —— 设置滚动条N毫秒后开始淡化,以毫秒为单位。
android:fadingEdge —— 设置拉滚动条时 ,边框渐变的放向
android:verticalScrollbarPosition —— 设置垂直滚动条的位置
android:scrollbarThumbHorizontal —— 设置水平滚动条的drawable。
android:scrollbarThumbVertical —— 设置垂直滚动条的drawable
android:scrollbarTrackHorizontal —— 设置水平滚动条背景(轨迹)的色drawable
android:scrollbarTrackVertical —— 设置垂直滚动条背景(轨迹)的色drawable
android:scrollbarAlwaysDrawHorizontalTrack —— 设置水平滚动条是否含有轨道
android:scrollbarAlwaysDrawVerticalTrack —— 设置垂直滚动条是否含有轨道
android:requiresFadingEdge —— 定义滚动时边缘是否褪色
------------------------------------End关于滚动条的设置------------------------------
------------------------------------常用设置------------------------------
android:descendantFocusability —— 控制子布局焦点获取方式 常用于listView的item中包含多个控件 点击无效
android:visibility —— 定义布局是否可见
android:clickable —— 定义是否可点击
android:longClickable —— 定义是否可长点击
android:saveEnabled —— 设置是否在窗口冻结时(如旋转屏幕)保存View的数据
android:filterTouchesWhenObscured —— 所在窗口被其它可见窗口遮住时,是否过滤触摸事件
android:keepScreenOn —— 设置屏幕常亮
android:soundEffectsEnabled —— 点击或触摸是否有声音效果
android:hapticFeedbackEnabled —— 设置触感反馈
------------------------------------End常用设置-------------------------
android:fitsSystemWindows —— 设置布局调整时是否考虑系统窗口(如状态栏)
android:drawingCacheQuality —— 设置绘图时半透明质量
android:OverScrollMode —— 滑动到边界时样式
android:alpha —— 设置透明度
android:rotation —— 旋转度数
android:rotationX —— 水平旋转度数
android:rotationY —— 垂直旋转度数
android:scaleX —— 设置X轴缩放
android:scaleY —— 设置Y轴缩放
android:layerType —— 设定支持
android:layoutDirection —— 定义布局图纸的方向
android:textDirection —— 定义文字方向
android:textAlignment —— 文字对齐方式
android:importantForAccessibility —— 设置可达性的重要行
android:labelFor —— 添加标签
android:persistentDrawingCachehua —— 定义绘图的高速缓存的持久性
android:layoutAnimation —— 定义布局显示时候的动画
android:tag —— 为布局添加tag方便查找与类似
android:nextFocusLeft —— 设置左边指定视图获得下一个焦点
android:nextFocusRight —— 设置右边指定视图获得下一个焦点
android:nextFocusUp —— 设置上边指定视图获得下一个焦点
android:nextFocusDown —— 设置下边指定视图获得下一个焦点
android:nextFocusForward —— 设置指定视图获得下一个焦点
android:contentDescription —— 说明
android:OnClick —— 点击时从上下文中调用指定的方法
android:animateLayoutChanges —— 布局改变时是否有动画效果
android:clipToPadding —— 定义布局间是否有间距
android:animationCache —— 定义子布局也有动画效果
android:alwaysDrawnWithCache —— 定义子布局是否应用绘图的高速缓存
android:addStatesFromChildren —— 定义布局是否应用子布局的背景
android:splitMotionEvents —— 定义布局是否传递touch事件到子布局
android:focusableInTouchMode —— 定义是否可以通过touch获取到焦点
android:isScrollContainer —— 定义布局是否作为一个滚动容器 可以调整整个窗体
android:duplicateParentState —— 是否从父容器中获取绘图状态(光标,按下等)