共用方式為


WindowManagerLayoutParams.Gravity Property

Definition

Placement of window within the screen as per Gravity.

[Android.Runtime.Register("gravity")]
public Android.Views.GravityFlags Gravity { get; set; }
[<Android.Runtime.Register("gravity")>]
member this.Gravity : Android.Views.GravityFlags with get, set

Property Value

Attributes

Remarks

Placement of window within the screen as per Gravity. Both Gravity#apply(int, int, int, android.graphics.Rect, int, int, android.graphics.Rect) Gravity.apply and Gravity#applyDisplay(int, android.graphics.Rect, android.graphics.Rect) Gravity.applyDisplay are used during window layout, with this value given as the desired gravity. For example you can specify Gravity#DISPLAY_CLIP_HORIZONTAL Gravity.DISPLAY_CLIP_HORIZONTAL and Gravity#DISPLAY_CLIP_VERTICAL Gravity.DISPLAY_CLIP_VERTICAL here to control the behavior of Gravity#applyDisplay(int, android.graphics.Rect, android.graphics.Rect) Gravity.applyDisplay.

Java documentation for android.view.WindowManager.LayoutParams.gravity.

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