Language

Layout.GetDesiredWidth Method

Definition

Overloads

Name Description
GetDesiredWidth(String, Int32, Int32, TextPaint)

Return how wide a layout must be in order to display the specified text slice with one line per paragraph.

GetDesiredWidth(ICharSequence, Int32, Int32, TextPaint)

Return how wide a layout must be in order to display the specified text slice with one line per paragraph.

GetDesiredWidth(ICharSequence, TextPaint)

Return how wide a layout must be in order to display the specified text with one line per paragraph.

GetDesiredWidth(String, TextPaint)

Return how wide a layout must be in order to display the specified text with one line per paragraph.

GetDesiredWidth(String, Int32, Int32, TextPaint)

Return how wide a layout must be in order to display the specified text slice with one line per paragraph.

public static float GetDesiredWidth(string? source, int start, int end, Android.Text.TextPaint? paint);
static member GetDesiredWidth : string * int * int * Android.Text.TextPaint -> single

Parameters

source
String

The text that contains the range to measure.

start
Int32

The first character index to include.

end
Int32

The character index at which the range stops, excluding that character.

paint
TextPaint

The paint that supplies text measurement settings.

Returns

The width in pixels needed by the widest paragraph in the selected range without line wrapping.

Remarks

Return how wide a layout must be in order to display the specified text slice with one line per paragraph.

As of O, Uses TextDirectionHeuristics#FIRSTSTRONG_LTR as the default text direction heuristics. In the earlier versions uses TextDirectionHeuristics#LTR as the default.

Java documentation for android.text.Layout.getDesiredWidth(java.lang.CharSequence, int, int, android.text.TextPaint).

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

GetDesiredWidth(ICharSequence, Int32, Int32, TextPaint)

Return how wide a layout must be in order to display the specified text slice with one line per paragraph.

[Android.Runtime.Register("getDesiredWidth", "(Ljava/lang/CharSequence;IILandroid/text/TextPaint;)F", "")]
public static float GetDesiredWidth(Java.Lang.ICharSequence? source, int start, int end, Android.Text.TextPaint? paint);
[<Android.Runtime.Register("getDesiredWidth", "(Ljava/lang/CharSequence;IILandroid/text/TextPaint;)F", "")>]
static member GetDesiredWidth : Java.Lang.ICharSequence * int * int * Android.Text.TextPaint -> single

Parameters

source
ICharSequence

The text that contains the range to measure.

start
Int32

The first character index to include.

end
Int32

The character index at which the range stops, excluding that character.

paint
TextPaint

The paint that supplies text measurement settings.

Returns

The width in pixels needed by the widest paragraph in the selected range without line wrapping.

Attributes

Remarks

Return how wide a layout must be in order to display the specified text slice with one line per paragraph.

As of O, Uses TextDirectionHeuristics#FIRSTSTRONG_LTR as the default text direction heuristics. In the earlier versions uses TextDirectionHeuristics#LTR as the default.

Java documentation for android.text.Layout.getDesiredWidth(java.lang.CharSequence, int, int, android.text.TextPaint).

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

GetDesiredWidth(ICharSequence, TextPaint)

Return how wide a layout must be in order to display the specified text with one line per paragraph.

[Android.Runtime.Register("getDesiredWidth", "(Ljava/lang/CharSequence;Landroid/text/TextPaint;)F", "")]
public static float GetDesiredWidth(Java.Lang.ICharSequence? source, Android.Text.TextPaint? paint);
[<Android.Runtime.Register("getDesiredWidth", "(Ljava/lang/CharSequence;Landroid/text/TextPaint;)F", "")>]
static member GetDesiredWidth : Java.Lang.ICharSequence * Android.Text.TextPaint -> single

Parameters

source
ICharSequence

The text whose paragraph widths are measured.

paint
TextPaint

The paint that supplies text measurement settings.

Returns

The width in pixels needed by the widest paragraph without line wrapping.

Attributes

Remarks

Return how wide a layout must be in order to display the specified text with one line per paragraph.

As of O, Uses TextDirectionHeuristics#FIRSTSTRONG_LTR as the default text direction heuristics. In the earlier versions uses TextDirectionHeuristics#LTR as the default.

Java documentation for android.text.Layout.getDesiredWidth(java.lang.CharSequence, android.text.TextPaint).

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

GetDesiredWidth(String, TextPaint)

Return how wide a layout must be in order to display the specified text with one line per paragraph.

public static float GetDesiredWidth(string? source, Android.Text.TextPaint? paint);
static member GetDesiredWidth : string * Android.Text.TextPaint -> single

Parameters

source
String

The text whose paragraph widths are measured.

paint
TextPaint

The paint that supplies text measurement settings.

Returns

The width in pixels needed by the widest paragraph without line wrapping.

Remarks

Return how wide a layout must be in order to display the specified text with one line per paragraph.

As of O, Uses TextDirectionHeuristics#FIRSTSTRONG_LTR as the default text direction heuristics. In the earlier versions uses TextDirectionHeuristics#LTR as the default.

Java documentation for android.text.Layout.getDesiredWidth(java.lang.CharSequence, android.text.TextPaint).

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