Partager via


WKInterfaceDevice.AddCachedImage Méthode

Définition

Surcharges

AddCachedImage(NSData, String)

Ajoute une image définie dans au imageData cache d’images de l’appareil.

AddCachedImage(UIImage, String)

AddCachedImage(NSData, String)

Ajoute une image définie dans au imageData cache d’images de l’appareil.

[Foundation.Export("addCachedImageWithData:name:")]
[ObjCRuntime.Unavailable(ObjCRuntime.PlatformName.WatchOS, ObjCRuntime.PlatformArchitecture.All, null)]
public virtual bool AddCachedImage(Foundation.NSData imageData, string name);
abstract member AddCachedImage : Foundation.NSData * string -> bool
override this.AddCachedImage : Foundation.NSData * string -> bool

Paramètres

imageData
NSData

Données d’image, au format natif ou sérialisé UIImage.

name
String

Identificateur. Si la valeur se trouve déjà dans le cache d’image, l’image existante est remplacée.

Retours

true si l’image a été correctement ajoutée au cache d’image.

Attributs

Remarques

Les développeurs qui souhaitent stocker des animations doivent créer l’intégralité de l’animation en un seul UIImage (voir CreateAnimatedImage(String, UIEdgeInsets, UIImageResizingMode, Double) surcharges), puis sérialiser le résultat UIImage à NSData pour l’argument imageData .

S’applique à

AddCachedImage(UIImage, String)

[Foundation.Export("addCachedImage:name:")]
[ObjCRuntime.Unavailable(ObjCRuntime.PlatformName.WatchOS, ObjCRuntime.PlatformArchitecture.All, null)]
public virtual bool AddCachedImage(UIKit.UIImage image, string name);
abstract member AddCachedImage : UIKit.UIImage * string -> bool
override this.AddCachedImage : UIKit.UIImage * string -> bool

Paramètres

image
UIImage
name
String

Retours

Attributs

S’applique à