iOS Guides | Samples

UIKit.UIImageAsset Class

Holds a mapping of UITraitCollection keys to UIImage values.

See Also: UIImageAsset


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


This is primarily used to hold images of varying resolutions appropriate to particular UITraitCollection displays.

Related content


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

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

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

ClassHandleIntPtr. The handle for this class.

Public Methods

Encodes the state of the object on the provided encoder
FromTraitCollection(UITraitCollection) : UIImage
Returns the image from the asset that best matches traitCollection.
RegisterImage(UIImage, UITraitCollection)
Registers image with the asset and associates it with traitCollection.
Finds the image that is associated with an exact match of traitCollection and unregisters from the image asset.