Upravit

Sdílet prostřednictvím


UIImage.FromBundle Method

Definition

Overloads

FromBundle(String)

Loads an image relative to the application bundle, and caches its result.

FromBundle(String, NSBundle, UITraitCollection)

Gets an image from the specified bundle that is compatible with the specified trait collection.

FromBundle(String)

Loads an image relative to the application bundle, and caches its result.

[Foundation.Advice("This API is thread-safe only on 9.0 and later.")]
[Foundation.Export("imageNamed:")]
[ObjCRuntime.ThreadSafe]
public static UIKit.UIImage FromBundle (string name);
static member FromBundle : string -> UIKit.UIImage

Parameters

name
String

Loads an image from the bundle with the specified path name.

Returns

Attributes

Remarks

The underlying UIKit implementation keeps a cache of all images requested. If you do not want UIKit to keep a cache, use FromFile or FromFileUncached.

This can be used from a background thread.

Applies to

FromBundle(String, NSBundle, UITraitCollection)

Gets an image from the specified bundle that is compatible with the specified trait collection.

[Foundation.Advice("This API is thread-safe only on 9.0 and later.")]
[Foundation.Export("imageNamed:inBundle:compatibleWithTraitCollection:")]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 8, 0, ObjCRuntime.PlatformArchitecture.All, null)]
[ObjCRuntime.ThreadSafe]
public static UIKit.UIImage FromBundle (string name, Foundation.NSBundle bundle, UIKit.UITraitCollection traitCollection);
static member FromBundle : string * Foundation.NSBundle * UIKit.UITraitCollection -> UIKit.UIImage

Parameters

name
String

Loads an image from the bundle with the specified path name.

bundle
NSBundle

The bundle in which the image file or asset catalog is located.

This parameter can be null.

traitCollection
UITraitCollection

Traits describing the desired image to be retrieved.

This parameter can be null.

Returns

Attributes

Remarks

(More documentation for this node is coming)

This can be used from a background thread.

Applies to