iOS Guides | Samples

MonoTouch.UIKit.UITraitCollection Class

Holds the horizontal and vertical size classes, as well as the user interface idiom and the display scale.

See Also: UITraitCollection

Syntax

[MonoTouch.Foundation.Register("UITraitCollection", true)]
[MonoTouch.ObjCRuntime.Introduced(MonoTouch.ObjCRuntime.PlatformName.iOS, 8, 0, MonoTouch.ObjCRuntime.PlatformArchitecture.None, null)]
public class UITraitCollection : NSObject, INSCopying, INSSecureCoding, IDisposable

See Also

Remarks

This class holds the elements describing the user interface traits to use to render a view or view controller. This contains components like the size class for the vertical or horizontal orientations (which is either compact or regular) as well as the user interface idiom (iPad or iPhone form factor) as well as the display scale.

This is typically used by developers when implementing their own UIViewController as well by a handful of classes that are UITraitCollection aware, like UIImage and UIImageAsset.

Related content

Requirements

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

The members of MonoTouch.UIKit.UITraitCollection 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

[read-only]
override
ClassHandleIntPtr. The handle for this class.
[read-only]
DisplayGamutUIDisplayGamut. The gamut to which these traits apply.
[read-only]
DisplayScaleSingle. The specified display scale for this trait collection.
[read-only]
ForceTouchCapabilityUIForceTouchCapability. Gets a trait that indicates whether 3D Touch is or is not available, or whether its availability is unknown.
[read-only]
HorizontalSizeClassUIUserInterfaceSizeClass. The specified horizontal size class specified for this trait collection.
[read-only]
LayoutDirectionUITraitEnvironmentLayoutDirection. Gets the environment layout direction.
[read-only]
PreferredContentSizeCategoryString. Gets a string describing the preferred content size category.
[read-only]
UserInterfaceIdiomUIUserInterfaceIdiom. The specified user interface idiom specified for this trait collection.
[read-only]
VerticalSizeClassUIUserInterfaceSizeClass. The specified vertical size class specified for this trait collection.

Public Methods

Contains(UITraitCollection) : Boolean
Probes whether this UITraitCollection contains all the traits specified.
Copy(NSZone) : NSObject
Performs a copy of the underlying Objective-C object.
static
FromDisplayGamut(UIDisplayGamut) : UITraitCollection
Static factory method to create a new UITraitCollection appropriate to the specified displayGamut.
static
FromDisplayScale(Single) : UITraitCollection
Creates a new UITraitCollection object where only the display scale has been specified.
static
FromForceTouchCapability(UIForceTouchCapability) : UITraitCollection
Creates a new UITraitCollection object where only the availability of 3D Touch has been specified.
static
FromHorizontalSizeClass(UIUserInterfaceSizeClass) : UITraitCollection
Creates a new UITraitCollection object where only the horizontal size class has been specified.
static
FromLayoutDirection(UITraitEnvironmentLayoutDirection) : UITraitCollection
Static factory method to create a UITraitCollection for the specified layoutDirection.
FromPreferredContentSizeCategory(UIContentSizeCategory) : UITraitCollection
Static factory method to create a UITraitCollection with the specified UIContentSizeCategory.
static
FromTraitsFromCollections(UITraitCollection[]) : UITraitCollection
Creates and returns a new trait collection by merging the trait collections that are contained in traitCollections.
static
FromUserInterfaceIdiom(UIUserInterfaceIdiom) : UITraitCollection
Creates a new UITraitCollection object where only the user interface idiom has been specified.
static
FromVerticalSizeClass(UIUserInterfaceSizeClass) : UITraitCollection
Creates a new UITraitCollection object where only the vertical size class has been specified.