setLineHeight

open fun setLineHeight(@NonNull textView: TextView, @Px @IntRange(from = 0) lineHeight: Int)(source)

Sets an explicit line height for this TextView. This is equivalent to the vertical distance between subsequent baselines in the TextView.

Parameters

textView

the TextView to modify

lineHeight

the line height in pixels

See also


open fun setLineHeight(@NonNull textView: TextView, unit: Int, @FloatRange(from = 0) lineHeight: Float)(source)

Sets an explicit line height to a given unit and value for the TextView. This is equivalent to the vertical distance between subsequent baselines in the TextView. See for the possible dimension units.

Parameters

textView

the TextView to modify

unit

The desired dimension unit. SP units are strongly recommended so that line height stays proportional to the text size when fonts are scaled up for accessibility.

lineHeight

The desired line height in the given units.

See also