iOS Guides | Samples

MonoTouch.UIKit.UILabel Class

A UIView that displays text.

See Also: UILabel

Syntax

[MonoTouch.Foundation.Register("UILabel", true)]
public class UILabel : UIView, IUIContentSizeCategoryAdjusting, IDisposable

Remarks

A read-only text field that can be used to display one or more lines of text.

Related content

Requirements

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

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

See Also: UIView

Public Constructors

Default constructor that initializes a new instance of this class with no parameters.
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.
Initializes the UILabel with the specified frame.
A constructor used when creating managed representations of unmanaged objects; Called by the runtime.

Public Properties

AdjustsFontForContentSizeCategoryBoolean.
AdjustsFontSizeToFitWidthBoolean. Whether the font size should be automatically reduced so that the title can be fully rendered in the UILabel's bounds.
AdjustsLetterSpacingToFitWidthBoolean. App developers should use MinimumScaleFactor rather than this deprecated method.
AllowsDefaultTighteningForTruncationBoolean. Whether the system can try to tighten the text prior to truncating it.
[read-only]
static
AppearanceUILabel+UILabelAppearance. Strongly-typed property that returns the UIAppearance class for this class.
AttributedTextNSAttributedString. Sets the text for the label using attributed strings.
BaselineAdjustmentUIBaselineAdjustment. How baselines are adjusted when the Text is shrunk to fit the UILabel's bounds.
[read-only]
override
ClassHandleIntPtr. The handle for this class.
EnabledBoolean. The enabled state to use when drawing this UILabel's Text.
FontUIFont. The font of the Text.
HighlightedBoolean. Whether this UILabel should be drawn with a highlight.
HighlightedTextColorUIColor. The color to use to highlight the label's Text.
LineBreakModeUILineBreakMode. The technique used for wrapping and truncating this UILabel's Text.
LinesInt32. The maximum number of lines to use for rendering the Text.
MinimumFontSizeSingle. App developers should use MinimumScaleFactor rather than this deprecated method.
MinimumScaleFactorSingle. The minimum scale supported for the Text.
PreferredMaxLayoutWidthSingle. The preferred maximum width, in points, for a multiline label.
ShadowColorUIColor. The color to use for the Text's shadow.
ShadowOffsetSizeF. The offset of the shadow, in points, from the Text.
TextString. The text displayed by this UILabel.
TextAlignmentUITextAlignment. Controls the text alignment.
TextColorUIColor. The color of the Text.

Public Methods

static
AppearanceWhenContainedIn(params Type[]) : UILabel+UILabelAppearance
Returns a strongly typed UIAppearance for instances of this class when the view is hosted in the specified hierarchy.
DrawText(RectangleF)
Renders this UILabel's Text (or its shadow) in the specified RectangleF.
static
GetAppearance(UITraitCollection) : UILabel+UILabelAppearance
Returns an appearance proxy for the specified traits.
static
GetAppearance(UITraitCollection, params Type[]) : UILabel+UILabelAppearance
Returns an appearance proxy for the specified traits when found in the containers containment hierarchy.
static
GetAppearance<T>() : UILabel+UILabelAppearance
Obtains the appearance proxy UILabelAppearance for the subclass of UILabel.
static
GetAppearance<T>(UITraitCollection) : UILabel+UILabelAppearance
Obtains the appearance proxy UILabelAppearance for the subclass of UILabel.
static
GetAppearance<T>(UITraitCollection, params Type[]) : UILabel+UILabelAppearance
Obtains the appearance proxy UILabelAppearance for the subclass of UILabel that has the specified trait collection when the view is hosted in the specified hierarchy.
TextRectForBounds(RectangleF, Int32) : RectangleF
The drawing RectangleF for this UILabel's Text.