码迷,mamicode.com
首页 > 其他好文 > 详细

addRule方法就要带一个view的id值

时间:2019-08-19 21:04:27      阅读:57      评论:0      收藏:0      [点我收藏+]

标签:nta   line   baseline   源码   stat   view   ott   方法   设置   

有了这个addRule方法就可以设置很多其他属性了,通过源码可知RelativeLayout是使用mRules这个数组来记录哪种属性使用到了,一共有22种属性:

/**
* Rule that aligns a child‘s right edge with another child‘s left edge.
*/
public static final int LEFT_OF = 0;
/**
* Rule that aligns a child‘s left edge with another child‘s right edge.
*/
public static final int RIGHT_OF = 1;
/**
* Rule that aligns a child‘s bottom edge with another child‘s top edge.
*/
public static final int ABOVE = 2;
/**
* Rule that aligns a child‘s top edge with another child‘s bottom edge.
*/
public static final int BELOW = 3;

/**
* Rule that aligns a child‘s baseline with another child‘s baseline.
*/
public static final int ALIGN_BASELINE = 4;
/**
* Rule that aligns a child‘s left edge with another child‘s left edge.
*/
public static final int ALIGN_LEFT = 5;
/**
* Rule that aligns a child‘s top edge with another child‘s top edge.
*/
public static final int ALIGN_TOP = 6;
/**
* Rule that aligns a child‘s right edge with another child‘s right edge.
*/
public static final int ALIGN_RIGHT = 7;
/**
* Rule that aligns a child‘s bottom edge with another child‘s bottom edge.
*/
public static final int ALIGN_BOTTOM = 8;

/**
* Rule that aligns the child‘s left edge with its RelativeLayout
* parent‘s left edge.
*/
public static final int ALIGN_PARENT_LEFT = 9;
/**
* Rule that aligns the child‘s top edge with its RelativeLayout
* parent‘s top edge.
*/
public static final int ALIGN_PARENT_TOP = 10;
/**
* Rule that aligns the child‘s right edge with its RelativeLayout
* parent‘s right edge.
*/
public static final int ALIGN_PARENT_RIGHT = 11;
/**
* Rule that aligns the child‘s bottom edge with its RelativeLayout
* parent‘s bottom edge.
*/
public static final int ALIGN_PARENT_BOTTOM = 12;

/**
* Rule that centers the child with respect to the bounds of its
* RelativeLayout parent.
*/
public static final int CENTER_IN_PARENT = 13;
/**
* Rule that centers the child horizontally with respect to the
* bounds of its RelativeLayout parent.
*/
public static final int CENTER_HORIZONTAL = 14;
/**
* Rule that centers the child vertically with respect to the
* bounds of its RelativeLayout parent.
*/
public static final int CENTER_VERTICAL = 15;
/**
* Rule that aligns a child‘s end edge with another child‘s start edge.
*/
public static final int START_OF = 16;
/**
* Rule that aligns a child‘s start edge with another child‘s end edge.
*/
public static final int END_OF = 17;
/**
* Rule that aligns a child‘s start edge with another child‘s start edge.
*/
public static final int ALIGN_START = 18;
/**
* Rule that aligns a child‘s end edge with another child‘s end edge.
*/
public static final int ALIGN_END = 19;
/**
* Rule that aligns the child‘s start edge with its RelativeLayout
* parent‘s start edge.
*/
public static final int ALIGN_PARENT_START = 20;
/**
* Rule that aligns the child‘s end edge with its RelativeLayout
* parent‘s end edge.
*/
public static final int ALIGN_PARENT_END = 21;
---------------------

addRule方法就要带一个view的id值

标签:nta   line   baseline   源码   stat   view   ott   方法   设置   

原文地址:https://www.cnblogs.com/hyhy904/p/11379394.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!