LayoutParams
来源:互联网 发布:excel2010数据分析工具 编辑:程序博客网 时间:2024/05/21 10:30
RelativeLayout.LayoutParams
Per-child layout information associated with RelativeLayout.
- Constructor
RelativeLayout.LayoutParams layoutParams = new LayoutParams(width, height);
构造函数,设置相对布局的宽高。
- layoutParams.rightMargin
一系列的Margin属性设置,设置right、left、top、bottom方向的Margin.
- addRule
public void addRule (int verb)
Added in API level 1
Adds a layout rule to be interpreted by the RelativeLayout. This method should only be used for constraints that don’t refer to another sibling (e.g., CENTER_IN_PARENT) or take a boolean value (TRUE for true or 0 for false). To specify a verb that takes a subject, use addRule(int, int) instead.
Parameters verb
One of the verbs defined by RelativeLayout, such as ALIGN_WITH_PARENT_LEFT.
public void addRule (int verb, int anchor)
Added in API level 1
Adds a layout rule to be interpreted by the RelativeLayout. Use this for verbs that take a target, such as a sibling (ALIGN_RIGHT) or a boolean value (VISIBLE).
Parameters verb
One of the verbs defined by RelativeLayout, such as ALIGN_WITH_PARENT_LEFT. anchor
The id of another view to use as an anchor, or a boolean value (represented as TRUE for true or 0 for false). For verbs that don’t refer to another sibling (for example, ALIGN_WITH_PARENT_BOTTOM) just use -1.
例子
layoutParams.addRule(RIGHT_OF, items[i - 1].getId());
上面的函数设置当前控件在 items[i-1].getId()
这个Id对应控件的右侧
- LayoutParams
- LayoutParams.***
- LayoutParams
- LayoutParams
- LayoutParams
- LayoutParams
- LayoutParams
- LayoutParams
- LayoutParams
- LayoutParams
- LayoutParams
- LayoutParams布局
- WindowManager.LayoutParams
- WindowManager.LayoutParams
- WindowManager.LayoutParams
- WindowManager.LayoutParams
- WindowManager.LayoutParams
- LayoutParams详解
- adapter的notifyDataSetChanged()无效
- getMeasured
- 初识Openstack
- 25.Linux: Linux系统下面: .o .a .so .ko .la区别
- 给 Android 开发者的 RxJava 详解
- LayoutParams
- vs 错误提示及解决方案
- 第四周 项目4-猴子选大王
- Android基本控件使用
- hammer.js---拖动滑块实现验证的小demo
- 寻找数组中最小的k个数(快排和堆排)
- 矩阵快速幂
- Unix网络编程之select版客户端实现
- 关于子线程里不能更新UI操作的解决方法