Compartilhar via


Layout Class

Definition

A base class that manages text layout in visual elements on the screen.

[Android.Runtime.Register("android/text/Layout", DoNotGenerateAcw=true)]
public abstract class Layout : Java.Lang.Object
[<Android.Runtime.Register("android/text/Layout", DoNotGenerateAcw=true)>]
type Layout = class
    inherit Object
Inheritance
Layout
Derived
Attributes

Remarks

A base class that manages text layout in visual elements on the screen.

For text that will be edited, use a DynamicLayout, which will be updated as the text changes. For text that will not change, use a StaticLayout.

Java documentation for android.text.Layout.

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.

Constructors

Layout(ICharSequence, TextPaint, Int32, Layout+Alignment, Single, Single)

Subclasses of Layout use this constructor to set the display text, width, and other standard properties.

Layout(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

Layout(String, TextPaint, Int32, Layout+Alignment, Single, Single)

Subclasses of Layout use this constructor to set the display text, width, and other standard properties.

Fields

DefaultLinespacingAddition
DefaultLinespacingMultiplier
HyphenationFrequencyFullFast
Obsolete.

Value for hyphenation frequency indicating the full amount of automatic hyphenation with using faster algorithm.

HyphenationFrequencyNormalFast
Obsolete.

Value for hyphenation frequency indicating a light amount of automatic hyphenation with using faster algorithm.

Properties

BottomPadding

Returns the number of extra pixels of descent padding in the bottom line of the Layout.

Class

Returns the runtime class of this Object.

(Inherited from Object)
EllipsizedWidth

Return the width to which this Layout is ellipsizing, or #getWidth if it is not doing anything special.

Handle

The handle to the underlying Android instance.

(Inherited from Object)
Height

Return the total height of this layout.

InclusionStrategyAnyOverlap
InclusionStrategyContainsAll
InclusionStrategyContainsCenter
IsFallbackLineSpacingEnabled

Return true if the fallback line space is enabled in this Layout.

IsSpanned
JniIdentityHashCode (Inherited from Object)
JniPeerMembers
LineCount

Return the number of lines of text in this layout.

Paint

Return the base Paint properties for this layout.

PeerReference (Inherited from Object)
SpacingAdd

Return the number of units of leading that are added to each line.

SpacingMultiplier

Return what the text height is multiplied by to get the line height.

Text
TextFormatted

Return the text that is displayed by this Layout.

ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

TopPadding

Returns the (negative) number of extra pixels of ascent padding in the top line of the Layout.

Width

Return the width of this layout.

Methods

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Draw(Canvas, IList<Path>, IList<Paint>, Path, Paint, Int32)

Draw this layout on the specified canvas.

Draw(Canvas, Path, Paint, Int32)

Draw this Layout on the specified canvas, with the highlight path drawn between the background and the text.

Draw(Canvas)

Draw this Layout on the specified Canvas.

DrawBackground(Canvas)

Draw background of this layout.

DrawText(Canvas)

Draw text part of this layout.

Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
FillCharacterBounds(Int32, Int32, Single[], Int32)

Return the characters' bounds in the given range.

GetAlignment()

Return the base alignment of this layout.

GetCursorPath(Int32, Path, ICharSequence)

Fills in the specified Path with a representation of a cursor at the specified offset.

GetCursorPath(Int32, Path, String)

Fills in the specified Path with a representation of a cursor at the specified offset.

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, Int32, Int32, TextPaint)

Return how wide a layout must be in order to display the specified text slice 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.

GetEllipsisCount(Int32)

Returns the number of characters to be ellipsized away, or 0 if no ellipsis is to take place.

GetEllipsisStart(Int32)

Return the offset of the first character to be ellipsized away, relative to the start of the line.

GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetLineAscent(Int32)

Get the ascent of the text on the specified line.

GetLineBaseline(Int32)

Return the vertical position of the baseline of the specified line.

GetLineBottom(Int32, Boolean)

Return the vertical position of the bottom of the specified line.

GetLineBottom(Int32)

Return the vertical position of the bottom of the specified line.

GetLineBounds(Int32, Rect)

Return the baseline for the specified line (0&hellip;getLineCount() - 1) If bounds is not null, return the top, left, right, bottom extents of the specified line in it.

GetLineContainsTab(Int32)

Returns whether the specified line contains one or more characters that need to be handled specially, like tabs.

GetLineDescent(Int32)

Return the descent of the specified line(0&hellip;getLineCount() - 1).

GetLineDirections(Int32)

Returns the directional run information for the specified line.

GetLineEnd(Int32)

Return the text offset after the last character on the specified line.

GetLineForOffset(Int32)

Get the line number on which the specified text offset appears.

GetLineForVertical(Int32)

Get the line number corresponding to the specified vertical position.

GetLineLeft(Int32)

Get the leftmost position that should be exposed for horizontal scrolling on the specified line.

GetLineMax(Int32)

Gets the unsigned horizontal extent of the specified line, including leading margin indent, but excluding trailing whitespace.

GetLineRight(Int32)

Get the rightmost position that should be exposed for horizontal scrolling on the specified line.

GetLineStart(Int32)

Return the text offset of the beginning of the specified line ( 0&hellip;getLineCount()).

GetLineTop(Int32)

Return the vertical position of the top of the specified line (0&hellip;getLineCount()).

GetLineVisibleEnd(Int32)

Return the text offset after the last visible character (so whitespace is not counted) on the specified line.

GetLineWidth(Int32)

Gets the unsigned horizontal extent of the specified line, including leading margin indent and trailing whitespace.

GetOffsetForHorizontal(Int32, Single)

Get the character offset on the specified line whose position is closest to the specified horizontal position.

GetOffsetToLeftOf(Int32)
GetOffsetToRightOf(Int32)
GetParagraphAlignment(Int32)

Get the alignment of the specified paragraph, taking into account markup attached to it.

GetParagraphDirection(Int32)

Returns the primary directionality of the paragraph containing the specified line, either 1 for left-to-right lines, or -1 for right-to-left lines (see #DIR_LEFT_TO_RIGHT, #DIR_RIGHT_TO_LEFT).

GetParagraphLeft(Int32)

Get the left edge of the specified paragraph, inset by left margins.

GetParagraphRight(Int32)

Get the right edge of the specified paragraph, inset by right margins.

GetPrimaryHorizontal(Int32)

Get the primary horizontal position for the specified text offset.

GetRangeForRect(RectF, SegmentFinder, Layout+ITextInclusionStrategy)
GetSecondaryHorizontal(Int32)

Get the secondary horizontal position for the specified text offset.

GetSelectionPath(Int32, Int32, Path)

Fills in the specified Path with a representation of a highlight between the specified offsets.

IncreaseWidthTo(Int32)

Increase the width of this layout to the specified width.

IsRtlCharAt(Int32)

Returns true if the character at offset is right to left (RTL).

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to