iOS Guides | Samples

MonoTouch.UIKit.NSLayoutManager Class

Responsible for layout of text stored in a NSTextStorage object.

See Also: NSLayoutManager

Syntax

[MonoTouch.Foundation.Register("NSLayoutManager", true)]
[MonoTouch.ObjCRuntime.Introduced(MonoTouch.ObjCRuntime.PlatformName.iOS, 7, 0, MonoTouch.ObjCRuntime.PlatformArchitecture.None, null)]
public class NSLayoutManager : NSObject, INSCoding, IDisposable

Remarks

iOS 7 introduced "Text Kit," a broad set of APIs and modifications of existing classes, built on MonoTouch.CoreText, that greatly expands the typographical flexibility of iOS.

The NSLayoutManager's NSLayoutManager.TextStorage property holds a reference to a NSTextStorage object, that holds a potentially large amount of styled text. The NSLayoutManager's NSLayoutManager.NSTextContainers property holds an ordered array of NSTextContainer objects in which it lays out text. The NSTextContainers, in turn, hold references to UITextView objects, which actually display the text.

Related content

Requirements

Namespace: MonoTouch.UIKit
Assembly: monotouch (in monotouch.dll)
Assembly Versions: 0.0.0.0

The members of MonoTouch.UIKit.NSLayoutManager are listed below.

See Also: NSObject

Public Constructors

Default constructor, initializes a new instance of this class.
A constructor that initializes the object from the data stored in the unarchiver object.
Constructor to call on derived classes to skip initialization and merely allocate the object.
A constructor used when creating managed representations of unmanaged objects; Called by the runtime.

Public Properties

AllowsNonContiguousLayoutBoolean. Whether layout can be done for a portion of the document without laying-out being recalculated from the beginning.
[read-only]
override
ClassHandleIntPtr. The handle for this class.
DelegateNSLayoutManagerDelegate. An instance of the MonoTouch.UIKit.NSLayoutManagerDelegate model class which acts as the class delegate.
[read-only]
ExtraLineFragmentRectRectangleF. The RectangleF needed for the insertion point.
[read-only]
ExtraLineFragmentTextContainerNSTextContainer. The NSTextContainer containing the NSLayoutManager.ExtraLineFragmentRect.
[read-only]
ExtraLineFragmentUsedRectRectangleF. The rectangle enclosing the insertion point.
[read-only]
FirstUnlaidCharacterIndexUInt32. The index of the first character that has not been laid out.
[read-only]
FirstUnlaidGlyphIndexUInt32. The index of the first glyph that has not been laid out.
[read-only]
HasNonContiguousLayoutBoolean. Whether the NSLayoutManager currently contains any areas of noncontiguous layout.
HyphenationFactorSingle. The hyphenation threshold.
[read-only]
NumberOfGlyphsUInt32. The number of glyphs in the NSLayoutManager.
ShowsControlCharactersBoolean. Specifies whether control characters should be shown or not.
ShowsInvisibleCharactersBoolean. Specifies whether normally-invisible characters such as whitespace should have visible glyphs.
[read-only]
TextContainersNSTextContainer[]. An array of NSTextContainers that model the geometric layout of a document.
TextStorageNSTextStorage. The NSTextStorage that holds the styled text to be laid out.
UsesFontLeadingBoolean. Whether the NSLayoutManager should use the leading provided in the font.
WeakDelegateNSObject. An object that can respond to the delegate protocol for this type

Public Methods

AddTextContainer(NSTextContainer)
Appends a NSTextContainer to the NSLayoutManager.TextContainers property.
AttachmentSizeForGlyphAtIndex(UInt32) : SizeF
The size of the attachment cell associated with the glyph at the specified index
BoundingRectForGlyphRange(NSRange, NSTextContainer) : RectangleF
The bounding rectangle, in container coordinates, for the glyphs in the specified range.
CharacterIndexForGlyphAtIndex(UInt32) : UInt32
The index of the first character associated with the glyph at the specified index.
CharacterIndexForPoint(PointF, NSTextContainer, ref Single) : UInt32
The index in NSLayoutManager.TextStorage for the specified point in the container's coordinate system.
CharacterRangeForGlyphRange(NSRange) : NSRange
The range of characters that generated the glyphs in the specified glyph range.
CharacterRangeForGlyphRange(NSRange, ref NSRange) : NSRange
The range of characters that generated the specified glyph range.
CharacterRangeForGlyphRangeInternal(NSRange, IntPtr) : NSRange
The characters that returned the glyphs in the specified glyph range.
DrawBackgroundForGlyphRange(NSRange, PointF)
Draws background marks for the given glyph range.
DrawGlyphs(NSRange, PointF)
Draws the specified glyph range.
DrawsOutsideLineFragmentForGlyphAtIndex(UInt32) : Boolean
Returns true if the specified glyph draws outside of its line fragment rectangle.
DrawStrikethrough(NSRange, NSUnderlineStyle, Single, RectangleF, NSRange, PointF)
Draws a strikethrough in the given style through the specified glyphs.
DrawUnderline(NSRange, NSUnderlineStyle, Single, RectangleF, NSRange, PointF)
Draws an underline in the specified style through the specified glyphs.
EnsureGlyphsForCharacterRange(NSRange)
Forces the NSLayoutManager to generate glyphs for the specified characters, if it has not already done so.
EnsureGlyphsForGlyphRange(NSRange)
Forces the NSLayoutManager to generate glyphs for the specified glyph range, if it has not already done so.
EnsureLayoutForBoundingRect(RectangleF, NSTextContainer)
Forces the NSLayoutManager to layout the specified rectangle, if it has not already done so.
EnsureLayoutForCharacterRange(NSRange)
Forces the NSLayoutManager to layout the specified characters, if it has not already done so.
EnsureLayoutForGlyphRange(NSRange)
Forces the NSLayoutManager to layout the specified glyphs, if it has not already done so.
EnsureLayoutForTextContainer(NSTextContainer)
Forces the NSLayoutManager to layout the specified NSTextContainer, if it has not already done so.
EnumerateEnclosingRects(NSRange, NSRange, NSTextContainer, NSTextLayoutEnumerateEnclosingRects)
Enumerates the enclosing rectangles for the specified glyph range.
EnumerateLineFragments(NSRange, NSTextLayoutEnumerateLineFragments)
Enumerate the line fragments intersecting with the specified glyph range.|Enumerate the line fragments intersecting with the specified glyph rane.
FractionOfDistanceThroughGlyphForPoint(PointF, NSTextContainer) : Single
Primitive method for NSLayoutManager.GlyphIndexForPoint.
GetFirstUnlaidCharacterIndex(ref UInt32, ref UInt32)
The indices of the first character and glyph that are not laid out.
GetGlyph(UInt32) : UInt16
GetGlyph(UInt32, ref Boolean) : UInt16
GetGlyphRange(NSTextContainer) : NSRange
The range of glyph indices contained in the specified NSTextContainer.
GetGlyphs(NSRange, Int16[], NSGlyphProperty[], UInt32[], Byte[]) : UInt32
The glyphs and information needed to perform layout for the specified glyphRange.
GetLineFragmentInsertionPoints(UInt32, Boolean, Boolean, IntPtr, IntPtr) : UInt32
Calculates the insertion points in a line fragment.
GetLineFragmentInsertionPoints(UInt32, Boolean, Boolean, Single[], Int32[]) : UInt32
Calculates the insertion points in a line fragment.
GetLineFragmentRect(UInt32, out NSRange, Boolean) : RectangleF
GetLineFragmentUsedRect(UInt32, out NSRange, Boolean) : RectangleF
GetTextContainer(UInt32, out NSRange, Boolean) : NSTextContainer
GetUsedRectForTextContainer(NSTextContainer) : RectangleF
The bounding rectangle in the NSTextContainer's coordinates of the laid out glyphs in the NSTextContainer.
GlyphAtIndex(UInt32) : UInt16
The glyph at the specified index.
GlyphAtIndex(UInt32, ref Boolean) : UInt16
The glyph at the given index.
GlyphIndexForCharacterAtIndex(UInt32) : UInt32
The glyph index for the character at the specified index.
GlyphIndexForPoint(PointF, NSTextContainer) : UInt32
The glyph index for the point in the container's coordinate system.
GlyphIndexForPoint(PointF, NSTextContainer, ref Single) : UInt32
The glyph index for the point in the container's coordinate system, plus a fraction of the distance between the location of the glyph returned and the next glyph.
GlyphRangeForBoundingRect(RectangleF, NSTextContainer) : NSRange
The minimum range that contains all the laid-out glyphs that at least partially overlap the specified bounds.
GlyphRangeForBoundingRectWithoutAdditionalLayout(RectangleF, NSTextContainer) : NSRange
The minimum range that contains all the laid-out glyphs that at least partially overlap the specified bounds.
GlyphRangeForCharacterRange(NSRange) : NSRange
The range of glyphs generated for the specified characters.
GlyphRangeForCharacterRange(NSRange, ref NSRange) : NSRange
The range of glyphs generated for the specified characters.
InsertTextContainer(NSTextContainer, Int32)
Inserts the specified NSTextContainer into NSLayoutManager.TextContainers at the specified index.
InvalidateDisplayForCharacterRange(NSRange)
Invalidates the display for the given character range.
InvalidateDisplayForGlyphRange(NSRange)
Invalidates the display for the given glyph range.
InvalidateGlyphs(NSRange, Int32, out NSRange)
Invalidates the cached glyphs for the given character range.
InvalidateLayout(NSRange, out NSRange)
Invalidates the layout for the specified character range. Does not automatically trigger re-layout.
IsValidGlyphIndex(UInt32) : Boolean
Whether the glyphIndex specifies a valid glyph.
LineFragmentRectForGlyphAtIndex(UInt32) : RectangleF
The RectangleF enclosing the line fragment in which the given glyph is laid out.
LineFragmentRectForGlyphAtIndex(UInt32, ref NSRange) : RectangleF
The RectangleF enclosing the line fragment for the glyph at the specified glyphIndex.
LineFragmentUsedRectForGlyphAtIndex(UInt32) : RectangleF
The RectangleF enclosing the line fragment for the glyph at the specified glyphIndex.
LineFragmentUsedRectForGlyphAtIndex(UInt32, ref NSRange) : RectangleF
The usage RectangleF for the line fragment for the glyph at the specified glyphIndex.
LocationForGlyphAtIndex(UInt32) : PointF
The location of the glyph at the specified index, relative to the containing line fragment's origin.
NotShownAttributeForGlyphAtIndex(UInt32) : Boolean
Whether the glyph at the specified index is shown.
ProcessEditing(NSTextStorage, NSTextStorageEditActions, NSRange, Int32, NSRange)
Indicates that an editing action has occurred.
PropertyForGlyphAtIndex(UInt32) : NSGlyphProperty
The NSGlyphProperty for the glyph at the specified index.
RangeOfNominallySpacedGlyphsContainingIndex(UInt32) : NSRange
The largest range of glyphs surrounding the glyph at the specified index that can be displayed using only advancement, not pairwise kerning or other adjustments.
RemoveTextContainer(Int32)
Removes the specified NSTextContainer from the NSLayoutManager.TextContainers array. Invalidates layout as necessary.
SetAttachmentSize(SizeF, NSRange)
Sets the size for drawing the attachment attached to the specified glyph.
SetDrawsOutsideLineFragment(Boolean, UInt32)
Specifies whether the glyph at the specified index draws outside the bounds of its line segment.
SetExtraLineFragmentRect(RectangleF, RectangleF, NSTextContainer)
Sets the bounds and container for the extra line fragment associated with a final hard line break.
SetGlyphs(IntPtr, IntPtr, IntPtr, UIFont, NSRange)
Specifies the initial glyphs and glyph properties for the specified character range.
SetLineFragmentRect(RectangleF, NSRange, RectangleF)
Specifies the line fragment rectangle for the specified glyph range.
SetLocation(PointF, NSRange)
Sets the location for the first glyph in the specified range.
SetNotShownAttribute(Boolean, UInt32)
Specifies that the glyph at the specified index should be marked as not shown.
SetTextContainer(NSTextContainer, NSRange)
Sets the NSTextContainer for the specified glyph range.
ShowCGGlyphs(Int16[], PointF[], UInt32, UIFont, CGAffineTransform, NSDictionary, CGContext)
Renders into the specified graphicsContext the glyphs at the specified positions and attributes.
Strikethrough(NSRange, NSUnderlineStyle, RectangleF, NSRange, PointF)
Strikes-through the specified glyph range.
TextContainerChangedGeometry(NSTextContainer)
Invalidates the layout information and glyphs for the specified NSTextContainer and any following.
TextContainerForGlyphAtIndex(UInt32) : NSTextContainer
The NSTextContainer in which the specified glyph is laid out.
TextContainerForGlyphAtIndex(UInt32, ref NSRange) : NSTextContainer
The NSTextContainer in which the specified glyph is laid out.
TruncatedGlyphRangeInLineFragmentForGlyphAtIndex(UInt32) : NSRange
The range of truncated glyphs for a line fragment containing the specified index.
Underline(NSRange, NSUnderlineStyle, RectangleF, NSRange, PointF)
Underlines the specified glyph range.

Protected Methods

override
Dispose(Boolean)
Releases the resources used by the NSLayoutManager object.