iOS Guides | Samples

UIKit.UIFontMetrics Class

Helper object for getting scalable Dynamic Type fonts.

See Also: UIFontMetrics

Syntax

[Foundation.Register("UIFontMetrics", true)]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.WatchOS, 4, 0, ObjCRuntime.PlatformArchitecture.None, null)]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.TvOS, 11, 0, ObjCRuntime.PlatformArchitecture.None, null)]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 11, 0, ObjCRuntime.PlatformArchitecture.None, null)]
public class UIFontMetrics : NSObject

Requirements

Namespace: UIKit
Assembly: Xamarin.iOS (in Xamarin.iOS.dll)
Assembly Versions: 0.0.0.0

The members of UIKit.UIFontMetrics are listed below.

See Also: NSObject

Public Constructors

Creates a new UIFontMetrics for the specified text style.

Protected Constructors

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

[read-only]
override
ClassHandleIntPtr. The handle for this class.
[read-only]
static
DefaultMetricsUIFontMetrics. Gets the default metrics for the style of this UIFontMetrics.

Public Methods

static
GetMetrics(String) : UIFontMetrics
Returns the default metrics for the specified style.
GetScaledFont(UIFont) : UIFont
Returns a version of a font that is scaled for the current metrics.
GetScaledFont(UIFont, nfloat) : UIFont
Returns a version of a font that is scaled for the current metrics and constrained to the specified maximum point size.
GetScaledFont(UIFont, UITraitCollection) : UIFont
Returns a version of a font that is scaled for the current metrics and trait collection.
GetScaledFont(UIFont, nfloat, UITraitCollection) : UIFont
Returns a version of a font that is scaled for the current metrics and trait collection, and is constrained to the specified maximum point size.
GetScaledValue(nfloat) : nfloat
Returns a layout height that is scaled from the current Dynamic Type settings.
GetScaledValue(nfloat, UITraitCollection) : nfloat
Returns a layout height that is scaled from the current Dynamic Type settings.