Share via


RelativeLayout.SetGravity(GravityFlags) Method

Definition

Describes how the child views are positioned.

[Android.Runtime.Register("setGravity", "(I)V", "GetSetGravity_IHandler")]
public virtual void SetGravity (Android.Views.GravityFlags gravity);
[<Android.Runtime.Register("setGravity", "(I)V", "GetSetGravity_IHandler")>]
abstract member SetGravity : Android.Views.GravityFlags -> unit
override this.SetGravity : Android.Views.GravityFlags -> unit

Parameters

gravity
GravityFlags

See android.view.Gravity

Attributes

Remarks

Describes how the child views are positioned. Defaults to Gravity.START | Gravity.TOP.

Note that since RelativeLayout considers the positioning of each child relative to one another to be significant, setting gravity will affect the positioning of all children as a single unit within the parent. This happens after children have been relatively positioned.

Java documentation for android.widget.RelativeLayout.setGravity(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.

Applies to

See also