Share via


Gravity.Apply Method

Definition

Overloads

Apply(GravityFlags, Int32, Int32, Rect, Rect)

Apply a gravity constant to an object.

Apply(GravityFlags, Int32, Int32, Rect, Rect, Int32)

Apply a gravity constant to an object and take care if layout direction is RTL or not.

Apply(GravityFlags, Int32, Int32, Rect, Int32, Int32, Rect)

Apply a gravity constant to an object.

Apply(GravityFlags, Int32, Int32, Rect, Int32, Int32, Rect, Int32)

Apply a gravity constant to an object.

Apply(GravityFlags, Int32, Int32, Rect, Rect)

Apply a gravity constant to an object.

[Android.Runtime.Register("apply", "(IIILandroid/graphics/Rect;Landroid/graphics/Rect;)V", "")]
public static void Apply (Android.Views.GravityFlags gravity, int w, int h, Android.Graphics.Rect? container, Android.Graphics.Rect? outRect);
[<Android.Runtime.Register("apply", "(IIILandroid/graphics/Rect;Landroid/graphics/Rect;)V", "")>]
static member Apply : Android.Views.GravityFlags * int * int * Android.Graphics.Rect * Android.Graphics.Rect -> unit

Parameters

gravity
GravityFlags

The desired placement of the object, as defined by the constants in this class.

w
Int32

The horizontal size of the object.

h
Int32

The vertical size of the object.

container
Rect

The frame of the containing space, in which the object will be placed. Should be large enough to contain the width and height of the object.

outRect
Rect

Receives the computed frame of the object in its container.

Attributes

Remarks

Apply a gravity constant to an object. This supposes that the layout direction is LTR.

Java documentation for android.view.Gravity.apply(int, int, int, android.graphics.Rect, android.graphics.Rect).

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

Apply(GravityFlags, Int32, Int32, Rect, Rect, Int32)

Apply a gravity constant to an object and take care if layout direction is RTL or not.

[Android.Runtime.Register("apply", "(IIILandroid/graphics/Rect;Landroid/graphics/Rect;I)V", "")]
public static void Apply (Android.Views.GravityFlags gravity, int w, int h, Android.Graphics.Rect container, Android.Graphics.Rect outRect, int layoutDirection);
[<Android.Runtime.Register("apply", "(IIILandroid/graphics/Rect;Landroid/graphics/Rect;I)V", "")>]
static member Apply : Android.Views.GravityFlags * int * int * Android.Graphics.Rect * Android.Graphics.Rect * int -> unit

Parameters

gravity
GravityFlags

The desired placement of the object, as defined by the constants in this class.

w
Int32

The horizontal size of the object.

h
Int32

The vertical size of the object.

container
Rect

The frame of the containing space, in which the object will be placed. Should be large enough to contain the width and height of the object.

outRect
Rect

Receives the computed frame of the object in its container.

layoutDirection
Int32

The layout direction.

Attributes

Remarks

Apply a gravity constant to an object and take care if layout direction is RTL or not.

Java documentation for android.view.Gravity.apply(int, int, int, android.graphics.Rect, android.graphics.Rect, 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

Apply(GravityFlags, Int32, Int32, Rect, Int32, Int32, Rect)

Apply a gravity constant to an object.

[Android.Runtime.Register("apply", "(IIILandroid/graphics/Rect;IILandroid/graphics/Rect;)V", "")]
public static void Apply (Android.Views.GravityFlags gravity, int w, int h, Android.Graphics.Rect container, int xAdj, int yAdj, Android.Graphics.Rect outRect);
[<Android.Runtime.Register("apply", "(IIILandroid/graphics/Rect;IILandroid/graphics/Rect;)V", "")>]
static member Apply : Android.Views.GravityFlags * int * int * Android.Graphics.Rect * int * int * Android.Graphics.Rect -> unit

Parameters

gravity
GravityFlags

The desired placement of the object, as defined by the constants in this class.

w
Int32

The horizontal size of the object.

h
Int32

The vertical size of the object.

container
Rect

The frame of the containing space, in which the object will be placed. Should be large enough to contain the width and height of the object.

xAdj
Int32

Offset to apply to the X axis. If gravity is LEFT this pushes it to the right; if gravity is RIGHT it pushes it to the left; if gravity is CENTER_HORIZONTAL it pushes it to the right or left; otherwise it is ignored.

yAdj
Int32

Offset to apply to the Y axis. If gravity is TOP this pushes it down; if gravity is BOTTOM it pushes it up; if gravity is CENTER_VERTICAL it pushes it down or up; otherwise it is ignored.

outRect
Rect

Receives the computed frame of the object in its container.

Attributes

Remarks

Apply a gravity constant to an object.

Java documentation for android.view.Gravity.apply(int, int, int, android.graphics.Rect, int, int, android.graphics.Rect).

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

Apply(GravityFlags, Int32, Int32, Rect, Int32, Int32, Rect, Int32)

Apply a gravity constant to an object.

[Android.Runtime.Register("apply", "(IIILandroid/graphics/Rect;IILandroid/graphics/Rect;I)V", "")]
public static void Apply (Android.Views.GravityFlags gravity, int w, int h, Android.Graphics.Rect container, int xAdj, int yAdj, Android.Graphics.Rect outRect, int layoutDirection);
[<Android.Runtime.Register("apply", "(IIILandroid/graphics/Rect;IILandroid/graphics/Rect;I)V", "")>]
static member Apply : Android.Views.GravityFlags * int * int * Android.Graphics.Rect * int * int * Android.Graphics.Rect * int -> unit

Parameters

gravity
GravityFlags

The desired placement of the object, as defined by the constants in this class.

w
Int32

The horizontal size of the object.

h
Int32

The vertical size of the object.

container
Rect

The frame of the containing space, in which the object will be placed. Should be large enough to contain the width and height of the object.

xAdj
Int32

Offset to apply to the X axis. If gravity is LEFT this pushes it to the right; if gravity is RIGHT it pushes it to the left; if gravity is CENTER_HORIZONTAL it pushes it to the right or left; otherwise it is ignored.

yAdj
Int32

Offset to apply to the Y axis. If gravity is TOP this pushes it down; if gravity is BOTTOM it pushes it up; if gravity is CENTER_VERTICAL it pushes it down or up; otherwise it is ignored.

outRect
Rect

Receives the computed frame of the object in its container.

layoutDirection
Int32

The layout direction.

Attributes

Remarks

Apply a gravity constant to an object.

Java documentation for android.view.Gravity.apply(int, int, int, android.graphics.Rect, int, int, android.graphics.Rect, 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