Language

TextUtils.Ellipsize Method

Definition

Overloads

Name Description
Ellipsize(String, TextPaint, Single, TextUtils+TruncateAt)

Returns the original text if it fits in the specified width given the properties of the specified Paint, or, if it does not fit, a truncated copy with ellipsis character added at the specified edge or center.

Ellipsize(String, TextPaint, Single, TextUtils+TruncateAt, Boolean, TextUtils+IEllipsizeCallback)

Returns the original text if it fits in the specified width given the properties of the specified Paint, or, if it does not fit, a truncated copy with ellipsis character added at the specified edge or center.

Ellipsize(String, TextPaint, Single, TextUtils+TruncateAt)

Returns the original text if it fits in the specified width given the properties of the specified Paint, or, if it does not fit, a truncated copy with ellipsis character added at the specified edge or center.

public static string? Ellipsize(string? text, Android.Text.TextPaint? p, float avail, Android.Text.TextUtils.TruncateAt? where);
static member Ellipsize : string * Android.Text.TextPaint * single * Android.Text.TextUtils.TruncateAt -> string

Parameters

text
String

The text to shorten if it exceeds the available width.

p
TextPaint

The paint used to measure the text.

avail
Single

The available horizontal width, in pixels.

where
TextUtils.TruncateAt

The edge or middle position at which to remove text.

Returns

The original text when it fits, or the ellipsized or empty result otherwise.

Remarks

Java documentation for android.text.TextUtils.ellipsize(java.lang.CharSequence, android.text.TextPaint, float, android.text.TruncateAt).

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

Ellipsize(String, TextPaint, Single, TextUtils+TruncateAt, Boolean, TextUtils+IEllipsizeCallback)

Returns the original text if it fits in the specified width given the properties of the specified Paint, or, if it does not fit, a truncated copy with ellipsis character added at the specified edge or center.

public static string? Ellipsize(string? text, Android.Text.TextPaint? paint, float avail, Android.Text.TextUtils.TruncateAt? where, bool preserveLength, Android.Text.TextUtils.IEllipsizeCallback? callback);
static member Ellipsize : string * Android.Text.TextPaint * single * Android.Text.TextUtils.TruncateAt * bool * Android.Text.TextUtils.IEllipsizeCallback -> string

Parameters

text
String

The text to shorten if it exceeds the available width.

paint
TextPaint

The paint used to measure the text.

avail
Single

The available horizontal width, in pixels.

where
TextUtils.TruncateAt

The edge or middle position at which to remove text.

preserveLength
Boolean

Whether to keep the original length by padding the ellipsized range with zero-width characters.

callback
TextUtils.IEllipsizeCallback

An optional callback that receives the removed range's start and exclusive end offsets.

Returns

The text after ellipsis processing, with its original length retained when preserveLength is true.

Remarks

Java documentation for android.text.TextUtils.ellipsize(java.lang.CharSequence, android.text.TextPaint, float, android.text.TruncateAt).

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