No. | 属 性名 称 | 方 法名 称 | 描 述 |
---|---|---|---|
1 | android:background | public void setBackgroundResoundResource(int resid) | 设置组件背景 |
2 | android:clickable | public void setClickable(boolean clickable) | 是否可以产生单机事件 |
3 | android:contentDescription | public void setContentDescription(CharSequence contentDescription) | 定义视图内容描述 |
4 | android:drawingCacheQuality | public void setDrawingCacheQuality(int quality) | 设置绘图时所需要的缓冲区大小 |
5 | android:focusable | public void setFocusable(boolean focusable) | 设置是否可以获得焦点 |
6 | android:focusableInTouchMode | public void setFocusableInTouchMode(boolean focusableInTouchMode) | 在触摸模式下配置是否可以获得焦点 |
7 | android:id | public void setId(int id) | 设置组件ID |
8 | android:longClickable | public void setLongClickable(boolean longClickable) | 设置长按事件是否可用 |
9 | android:minHeight | 定义视图最小高度 | |
10 | android:minWidth | 定义视图的最小宽度 | |
11 | android:padding | public void setPadding(int left,int top,int right,int bottom) | 填充所有的边缘 |
12 | android:paddingBottom | public void setPadding(int left,int top,int right,int bottom) | 填充下边缘 |
13 | android:paddingLeft | public void setPadding(int left,int top,int right,int bottom) | 填充左边缘 |
14 | android:paddingRight | public void setPadding(int left,int top,int right,int bottom) | 填充右边缘 |
15 | android:paddingTop | public void setPadding(int left,int top,int right,int bottom) | 填充上边缘 |
16 | android:scaleX | public void setScaleX(float scaleX) | 设置X轴缩放 |
17 | android:scaleY | public void setScaleY(float scaleY) | 设置Y轴缩放 |
18 | android:scrollbarSize | 设置滚动条大小 | |
19 | android:scrollbarStyle | public void setScrollBarStyle(int style) | 设置滚动条样式 |
20 | android:visibility | public void setVisibility(int visibility) | 设置是否显示组件 |
21 | android:layout_width | 定义组件显示的宽度 | |
22 | android:layout_height | 定义组件显示的高度 | |
23 | android:layout_gravity | 组件文字的对齐位置 | |
24 | android:layout_margin | 设置文字的边距 | |
25 | android:layout_marginTop | 上边距 | |
26 | android:layout_marginButtom | 下边距 | |
27 | android:layout_marginLeft | 左边距 | |
28 | android:layout_marginRight | 右边距 | |
29 | android:background | 设置背景颜色 |
android View 组件常用属性
最新推荐文章于 2021-11-23 20:31:02 发布