Window.SetGravity(GravityFlags) Method

Definition

Set the gravity of the window, as per the Gravity constants.

[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

The desired gravity constant.

Attributes

Remarks

Set the gravity of the window, as per the Gravity constants. This controls how the window manager is positioned in the overall window; it is only useful when using WRAP_CONTENT for the layout width or height.

Java documentation for android.view.Window.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

  • Gravity
  • <xref:Android.Views.Window.SetLayout(System.Int32%2c+System.Int32)>