Freigeben über


Toast.SetMargin(Single, Single) Method

Definition

Set the margins of the view.

[Android.Runtime.Register("setMargin", "(FF)V", "GetSetMargin_FFHandler")]
public virtual void SetMargin (float horizontalMargin, float verticalMargin);
[<Android.Runtime.Register("setMargin", "(FF)V", "GetSetMargin_FFHandler")>]
abstract member SetMargin : single * single -> unit
override this.SetMargin : single * single -> unit

Parameters

horizontalMargin
Single

The horizontal margin, in percentage of the container width, between the container's edges and the notification

verticalMargin
Single

The vertical margin, in percentage of the container height, between the container's edges and the notification

Attributes

Remarks

Set the margins of the view.

<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.setMargin(float, float).

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