Layout 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
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) 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) 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) 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 BottomPadding

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

Class Class

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

(Inherited from Object)
EllipsizedWidth EllipsizedWidth

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

Handle Handle

The handle to the underlying Android instance.

(Inherited from Object)
Height Height

Return the total height of this layout.

IJavaObjectEx.IsProxy IJavaObjectEx.IsProxy Inherited from Object
IJavaObjectEx.KeyHandle IJavaObjectEx.KeyHandle Inherited from Object
IJavaObjectEx.NeedsActivation IJavaObjectEx.NeedsActivation Inherited from Object
IJavaPeerable.JniManagedPeerState IJavaPeerable.JniManagedPeerState Inherited from Object
IsSpanned IsSpanned
JniIdentityHashCode JniIdentityHashCode Inherited from Object
JniPeerMembers JniPeerMembers
LineCount LineCount

Return the number of lines of text in this layout.

Paint Paint

Return the base Paint properties for this layout.

PeerReference PeerReference Inherited from Object
SpacingAdd SpacingAdd

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

SpacingMultiplier SpacingMultiplier

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

Text Text
TextFormatted TextFormatted

Return the text that is displayed by this Layout.

ThresholdClass ThresholdClass

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

ThresholdType ThresholdType

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

TopPadding TopPadding

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

Width Width

Return the width of this layout.

Methods

Clone() Clone()

Creates and returns a copy of this Object.

(Inherited from Object)
Dispose() Dispose() Inherited from Object
Dispose(Boolean) Dispose(Boolean) Inherited from Object
Draw(Canvas) Draw(Canvas)

Draw this Layout on the specified Canvas.

Draw(Canvas, Path, Paint, Int32) 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) Equals(Object)

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

(Inherited from Object)
GetAlignment() GetAlignment()

Return the base alignment of this layout.

GetCursorPath(Int32, Path, ICharSequence) GetCursorPath(Int32, Path, ICharSequence)

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

GetCursorPath(Int32, Path, String) GetCursorPath(Int32, Path, String)
GetDesiredWidth(ICharSequence, Int32, Int32, TextPaint) 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) 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, Int32, Int32, TextPaint)
GetDesiredWidth(String, TextPaint) GetDesiredWidth(String, TextPaint)
GetEllipsisCount(Int32) GetEllipsisCount(Int32)

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

GetEllipsisStart(Int32) GetEllipsisStart(Int32)

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

GetHashCode() GetHashCode()

Returns an integer hash code for this object.

(Inherited from Object)
GetLineAscent(Int32) GetLineAscent(Int32)

Get the ascent of the text on the specified line.

GetLineBaseline(Int32) GetLineBaseline(Int32)

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

GetLineBottom(Int32) GetLineBottom(Int32)

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

GetLineBounds(Int32, Rect) 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) GetLineContainsTab(Int32)

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

GetLineDescent(Int32) GetLineDescent(Int32)

Return the descent of the specified line(0…getLineCount() - 1).

GetLineDirections(Int32) GetLineDirections(Int32)

Returns the directional run information for the specified line.

GetLineEnd(Int32) GetLineEnd(Int32)

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

GetLineForOffset(Int32) GetLineForOffset(Int32)

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

GetLineForVertical(Int32) GetLineForVertical(Int32)

Get the line number corresponding to the specified vertical position.

GetLineLeft(Int32) GetLineLeft(Int32)

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

GetLineMax(Int32) GetLineMax(Int32)

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

GetLineRight(Int32) GetLineRight(Int32)

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

GetLineStart(Int32) GetLineStart(Int32)

Return the text offset of the beginning of the specified line ( 0…getLineCount()).

GetLineTop(Int32) GetLineTop(Int32)

Return the vertical position of the top of the specified line (0…getLineCount()).

GetLineVisibleEnd(Int32) GetLineVisibleEnd(Int32)

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

GetLineWidth(Int32) GetLineWidth(Int32)

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

GetOffsetForHorizontal(Int32, Single) GetOffsetForHorizontal(Int32, Single)

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

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

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

GetParagraphDirection(Int32) GetParagraphDirection(Int32)
GetParagraphLeft(Int32) GetParagraphLeft(Int32)

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

GetParagraphRight(Int32) GetParagraphRight(Int32)

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

GetPrimaryHorizontal(Int32) GetPrimaryHorizontal(Int32)

Get the primary horizontal position for the specified text offset.

GetSecondaryHorizontal(Int32) GetSecondaryHorizontal(Int32)

Get the secondary horizontal position for the specified text offset.

GetSelectionPath(Int32, Int32, Path) GetSelectionPath(Int32, Int32, Path)

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

IncreaseWidthTo(Int32) IncreaseWidthTo(Int32)

Increase the width of this layout to the specified width.

IsRtlCharAt(Int32) IsRtlCharAt(Int32)

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

JavaFinalize() JavaFinalize()

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

(Inherited from Object)
Notify() 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() 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) SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

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

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

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

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

(Inherited from Object)
Wait(Int64) 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) 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.ToLocalJniHandle() IJavaObjectEx.ToLocalJniHandle() Inherited from Object
IJavaPeerable.Disposed() IJavaPeerable.Disposed() Inherited from Object
IJavaPeerable.DisposeUnlessReferenced() IJavaPeerable.DisposeUnlessReferenced() Inherited from Object
IJavaPeerable.Finalized() IJavaPeerable.Finalized() Inherited from Object
IJavaPeerable.SetJniIdentityHashCode(Int32) IJavaPeerable.SetJniIdentityHashCode(Int32) Inherited from Object
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) Inherited from Object
IJavaPeerable.SetPeerReference(JniObjectReference) IJavaPeerable.SetPeerReference(JniObjectReference) Inherited from Object

Extension Methods

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject) JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable) GetJniTypeName(IJavaPeerable)

Applies to