Udostępnij za pośrednictwem


RelativeLayout.LayoutParams.AddRule Method

Definition

Overloads

AddRule(LayoutRules)

Adds a layout rule to be interpreted by the RelativeLayout.

AddRule(LayoutRules, Int32)

Adds a layout rule to be interpreted by the RelativeLayout.

AddRule(LayoutRules)

Adds a layout rule to be interpreted by the RelativeLayout.

[Android.Runtime.Register("addRule", "(I)V", "GetAddRule_IHandler")]
public virtual void AddRule (Android.Widget.LayoutRules verb);
[<Android.Runtime.Register("addRule", "(I)V", "GetAddRule_IHandler")>]
abstract member AddRule : Android.Widget.LayoutRules -> unit
override this.AddRule : Android.Widget.LayoutRules -> unit

Parameters

verb
LayoutRules

a layout verb, such as #ALIGN_PARENT_LEFT

Attributes

Remarks

Adds a layout rule to be interpreted by the RelativeLayout.

This method should only be used for verbs that don't refer to a sibling (ex. #ALIGN_RIGHT) or take a boolean value (#TRUE for true or 0 for false). To specify a verb that takes a subject, use #addRule(int, int).

If the rule is relative to the layout direction (ex. #ALIGN_PARENT_START), then the layout direction must be resolved using #resolveLayoutDirection(int) before calling #getRule(int) an absolute rule (ex. #ALIGN_PARENT_LEFT.

Java documentation for android.widget.RelativeLayout.LayoutParams.addRule(int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

See also

  • <xref:Android.Widget.RelativeLayout.LayoutParams.AddRule(Android.Widget.LayoutRules%2c+System.Int32)>

Applies to

AddRule(LayoutRules, Int32)

Adds a layout rule to be interpreted by the RelativeLayout.

[Android.Runtime.Register("addRule", "(II)V", "GetAddRule_IIHandler")]
public virtual void AddRule (Android.Widget.LayoutRules verb, int subject);
[<Android.Runtime.Register("addRule", "(II)V", "GetAddRule_IIHandler")>]
abstract member AddRule : Android.Widget.LayoutRules * int -> unit
override this.AddRule : Android.Widget.LayoutRules * int -> unit

Parameters

verb
LayoutRules

a layout verb, such as #ALIGN_RIGHT

subject
Int32

the ID of another view to use as an anchor, or a boolean value (represented as #TRUE for true or 0 for false)

Attributes

Remarks

Adds a layout rule to be interpreted by the RelativeLayout.

Use this for verbs that refer to a sibling (ex. #ALIGN_RIGHT) or take a boolean value (ex. #CENTER_IN_PARENT).

If the rule is relative to the layout direction (ex. #START_OF), then the layout direction must be resolved using #resolveLayoutDirection(int) before calling #getRule(int) with an absolute rule (ex. #LEFT_OF.

Java documentation for android.widget.RelativeLayout.LayoutParams.addRule(int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

See also

Applies to