Layout Class

Definition

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

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

Remarks

Android platform documentation

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.

Properties

BottomPadding

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

Class

Returns the unique instance of Class that represents this object's class.

(Inherited from Object)
EllipsizedWidth

Return the width to which this Layout is ellipsizing, or Width 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.

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)

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.

Equals(Object)

Compares this instance with the specified object and indicates if they are equal.

(Inherited from Object)
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)
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)
GetDesiredWidth(String, TextPaint)
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 an integer hash code for this 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)

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

GetLineBounds(Int32, Rect)

Return the baseline for the specified line (0…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 or emoji.

GetLineDescent(Int32)

Return the descent of the specified line(0…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…getLineCount()).

GetLineTop(Int32)

Return the vertical position of the top of the specified line (0…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)
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.

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()

Invoked when the garbage collector has detected that this instance is no longer reachable.

(Inherited from Object)
Notify()

Causes a thread which is waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.

(Inherited from Object)
NotifyAll()

Causes all threads which are waiting on this object's monitor (by means of calling one of the wait() methods) to be woken up.

(Inherited from Object)
SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

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

Returns a string containing a concise, human-readable description of this object.

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

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.

(Inherited from Object)
Wait(Int64)

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

(Inherited from Object)
Wait(Int64, Int32)

Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the specified timeout expires.

(Inherited from Object)

Explicit Interface Implementations

IJavaObjectEx.IsProxy (Inherited from Object)
IJavaObjectEx.KeyHandle (Inherited from Object)
IJavaObjectEx.NeedsActivation (Inherited from Object)
IJavaObjectEx.ToLocalJniHandle() (Inherited from Object)
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