zoukankan      html  css  js  c++  java
  • addRule方法就要带一个view的id值

    有了这个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;
    ---------------------

  • 相关阅读:
    函数
    拉取代码到本地
    逻辑位运算符 以及 布尔运算符&&、||
    JS中substr与substring的区别
    ? :和!:的用法含义及es6语法...
    JS中attribute和property的区别
    并发、并行的理解
    斑鸠云商小程序记住账号和密码
    js中的foreach用法
    指针与数组
  • 原文地址:https://www.cnblogs.com/hyhy904/p/11379394.html
Copyright © 2011-2022 走看看