iOS Guides | Samples

MonoTouch.UIKit.UIContentSizeCategory Enumeration

An enumeration whose values specify the various dynamic type sizes that can be chosen by the application user.

Syntax

[MonoTouch.ObjCRuntime.Introduced(MonoTouch.ObjCRuntime.PlatformName.iOS, 7, 0, MonoTouch.ObjCRuntime.PlatformArchitecture.None, null)]
[MonoTouch.ObjCRuntime.Unavailable(MonoTouch.ObjCRuntime.PlatformName.WatchOS, MonoTouch.ObjCRuntime.PlatformArchitecture.All, null)]
public enum UIContentSizeCategory

Remarks

After the application user has set the "Text Size Property" in Settings, the application will receive a notification via UIApplication+Notifications.ObserveContentSizeCategoryChanged. It is the application developer's responsibility, at that point, to invalidate the layout in all view elements that implement Dynamic Type. The simplest way to do that is to have a method that re-sets the font in all components that support Dynamic Type:

C# Example

 UIApplication.Notifications.ObserveContentSizeCategoryChanged((s,e) => {
	SetDynamicTypeFonts();
});

//Call this when initializing, and also in response to ObserveContentSizeCategoryChanged notifications
private void SetDynamicTypeFonts()
{
	headlineLabel.Font = UIFont.PreferredFontForTextStyle(UIFontTextStyle.Headline);
	bodyText.Font = UIFont.PreferredFontForTextStyle(UIFontTextStyle.Body);
  //...etc...
}

Members

Member NameDescription
AccessibilityExtraExtraExtraLargeA medium font reflecting the current accessibility settings.
AccessibilityExtraExtraLargeA medium font reflecting the current accessibility settings.
AccessibilityExtraLargeA medium font reflecting the current accessibility settings.
AccessibilityLargeA medium font reflecting the current accessibility settings.
AccessibilityMediumA medium font reflecting the current accessibility settings.
ExtraExtraExtraLargeA font that's larger than ExtraExtraLarge.
ExtraExtraLargeA font that's larger than ExtraLarge.
ExtraLargeAn extra-large font.
ExtraSmallQuite small.
LargeA large font.
MediumA medium-sized font.
SmallA small font.
Unspecified

Requirements

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

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

See Also: Enum

Public Fields

AccessibilityExtraExtraExtraLargeUIContentSizeCategory. A medium font reflecting the current accessibility settings.
AccessibilityExtraExtraLargeUIContentSizeCategory. A medium font reflecting the current accessibility settings.
AccessibilityExtraLargeUIContentSizeCategory. A medium font reflecting the current accessibility settings.
AccessibilityLargeUIContentSizeCategory. A medium font reflecting the current accessibility settings.
AccessibilityMediumUIContentSizeCategory. A medium font reflecting the current accessibility settings.
ExtraExtraExtraLargeUIContentSizeCategory. A font that's larger than ExtraExtraLarge.
ExtraExtraLargeUIContentSizeCategory. A font that's larger than ExtraLarge.
ExtraLargeUIContentSizeCategory. An extra-large font.
ExtraSmallUIContentSizeCategory. Quite small.
LargeUIContentSizeCategory. A large font.
MediumUIContentSizeCategory. A medium-sized font.
SmallUIContentSizeCategory. A small font.
UnspecifiedUIContentSizeCategory.