Share via


View.SetX(Single) Method

Definition

Sets the visual x position of this view, in pixels.

[Android.Runtime.Register("setX", "(F)V", "GetSetX_FHandler")]
public virtual void SetX (float x);
[<Android.Runtime.Register("setX", "(F)V", "GetSetX_FHandler")>]
abstract member SetX : single -> unit
override this.SetX : single -> unit

Parameters

x
Single

The visual x position of this view, in pixels.

Attributes

Remarks

Sets the visual x position of this view, in pixels. This is equivalent to setting the #setTranslationX(float) translationX property to be the difference between the x value passed in and the current #getLeft() left property.

Java documentation for android.view.View.setX(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