RelativeLayout.LayoutParams

      RelativeLayout.LayoutParams


继承关系:

java.lang.Object  --->android.view.ViewGroup.LayoutParams--->android.view.ViewGroup.MarginLayoutParams--->

android.widget.RelativeLayout.LayoutParams

XML Attributes

Attribute Name Related Method Description
android:layout_above Positions the bottom edge of this view above the given anchor view ID. 
android:layout_alignBaseline Positions the baseline of this view on the baseline of the given anchor view ID. 
android:layout_alignBottom Makes the bottom edge of this view match the bottom edge of the given anchor view ID. 
android:layout_alignEnd Makes the end edge of this view match the end edge of the given anchor view ID. 
android:layout_alignLeft Makes the left edge of this view match the left edge of the given anchor view ID. 
android:layout_alignParentBottom If true, makes the bottom edge of this view match the bottom edge of the parent. 
android:layout_alignParentEnd If true, makes the end edge of this view match the end edge of the parent. 
android:layout_alignParentLeft If true, makes the left edge of this view match the left edge of the parent. 
android:layout_alignParentRight If true, makes the right edge of this view match the right edge of the parent. 
android:layout_alignParentStart If true, makes the start edge of this view match the start edge of the parent. 
android:layout_alignParentTop If true, makes the top edge of this view match the top edge of the parent. 
android:layout_alignRight Makes the right edge of this view match the right edge of the given anchor view ID. 
android:layout_alignStart Makes the start edge of this view match the start edge of the given anchor view ID. 
android:layout_alignTop Makes the top edge of this view match the top edge of the given anchor view ID. 
android:layout_alignWithParentIfMissing If set to true, the parent will be used as the anchor when the anchor cannot be             be found for layout_toLeftOf, layout_toRightOf, etc. 
android:layout_below Positions the top edge of this view below the given anchor view ID. 
android:layout_centerHorizontal If true, centers this child horizontally within its parent. 
android:layout_centerInParent If true, centers this child horizontally and vertically within its parent. 
android:layout_centerVertical If true, centers this child vertically within its parent. 
android:layout_toEndOf Positions the start edge of this view to the end of the given anchor view ID. 
android:layout_toLeftOf Positions the right edge of this view to the left of the given anchor view ID. 
android:layout_toRightOf Positions the left edge of this view to the right of the given anchor view ID. 
android:layout_toStartOf Positions the end edge of this view to the start of the given anchor view ID. 

 

Class Overview


Per-child layout information associated with RelativeLayout.//per:每,每一

Public Methods


public void addRule (int verb)  //rule:规则  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.
See Also


   

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值