TextView.FirstBaselineToTopHeight Property

Definition

Returns the distance between the first text baseline and the top of this TextView. -or- Updates the top padding of the TextView so that firstBaselineToTopHeight is the distance between the top of the TextView and first line's baseline.

public virtual int FirstBaselineToTopHeight { [Android.Runtime.Register("getFirstBaselineToTopHeight", "()I", "GetGetFirstBaselineToTopHeightHandler", ApiSince=28)] get; [Android.Runtime.Register("setFirstBaselineToTopHeight", "(I)V", "GetSetFirstBaselineToTopHeight_IHandler", ApiSince=28)] set; }
[<get: Android.Runtime.Register("getFirstBaselineToTopHeight", "()I", "GetGetFirstBaselineToTopHeightHandler", ApiSince=28)>]
[<set: Android.Runtime.Register("setFirstBaselineToTopHeight", "(I)V", "GetSetFirstBaselineToTopHeight_IHandler", ApiSince=28)>]
member this.FirstBaselineToTopHeight : int with get, set

Property Value

Attributes

Remarks

Property getter documentation:

Returns the distance between the first text baseline and the top of this TextView.

Java documentation for android.widget.TextView.getFirstBaselineToTopHeight().

Property setter documentation:

Updates the top padding of the TextView so that firstBaselineToTopHeight is the distance between the top of the TextView and first line's baseline.

<img src="https://developer.android.com/reference/android/images/text/widget/first_last_baseline.png" /> <figcaption>First and last baseline metrics for a TextView.</figcaption>

<strong>Note</strong> that if FontMetrics.top or FontMetrics.ascent was already greater than firstBaselineToTopHeight, the top padding is not updated. Moreover since this function sets the top padding, if the height of the TextView is less than the sum of top padding, line height and bottom padding, top of the line will be pushed down and bottom will be clipped.

Java documentation for android.widget.TextView.setFirstBaselineToTopHeight(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