次の方法で共有


Toast.SetGravity(GravityFlags, Int32, Int32) Method

Definition

Set the location at which the notification should appear on the screen.

[Android.Runtime.Register("setGravity", "(III)V", "GetSetGravity_IIIHandler")]
public virtual void SetGravity (Android.Views.GravityFlags gravity, int xOffset, int yOffset);
[<Android.Runtime.Register("setGravity", "(III)V", "GetSetGravity_IIIHandler")>]
abstract member SetGravity : Android.Views.GravityFlags * int * int -> unit
override this.SetGravity : Android.Views.GravityFlags * int * int -> unit

Parameters

gravity
GravityFlags
xOffset
Int32
yOffset
Int32
Attributes

Remarks

Set the location at which the notification should appear on the screen.

<strong>Warning:</strong> Starting from Android Build.VERSION_CODES#R, for apps targeting API level Build.VERSION_CODES#R or higher, this method is a no-op when called on text toasts.

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

Applies to

See also