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;
    ---------------------

  • 相关阅读:
    截取小数位数(准确四舍五入及直接截取)
    水印
    用心整理的 献丑啦 一些关于http url qs fs ...模块的方法
    html禁止清除input文本输入缓存的两种方法
    flink写入elasticsearch报错!OOM内存溢出!连接异常关闭!
    实现网格建造系统
    AcWing 1064. 小国王
    AcWing 1052. 设计密码
    KMP 模板
    AcWing 1058. 股票买卖 V
  • 原文地址:https://www.cnblogs.com/hyhy904/p/11379394.html
Copyright © 2011-2022 走看看