UIColor.FromName Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
FromName(String) |
Creates and returns a new color object from the asset with the specified name, with the gamut in the specified asset. |
FromName(String, NSBundle, UITraitCollection) |
Creates and returns a new color object from the asset with the specified name in the specified bundle, with the gamut in the specified trait collection. |
FromName(String)
Creates and returns a new color object from the asset with the specified name, with the gamut in the specified asset.
[Foundation.Export("colorNamed:")]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 11, 0, ObjCRuntime.PlatformArchitecture.All, null)]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.TvOS, 11, 0, ObjCRuntime.PlatformArchitecture.All, null)]
public static UIKit.UIColor FromName (string name);
static member FromName : string -> UIKit.UIColor
Parameters
- name
- String
The name of a color asset in the application bundle.
Returns
- Attributes
Remarks
(More documentation for this node is coming)
This can be used from a background thread.
Applies to
FromName(String, NSBundle, UITraitCollection)
Creates and returns a new color object from the asset with the specified name in the specified bundle, with the gamut in the specified trait collection.
[Foundation.Export("colorNamed:inBundle:compatibleWithTraitCollection:")]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 11, 0, ObjCRuntime.PlatformArchitecture.All, null)]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.TvOS, 11, 0, ObjCRuntime.PlatformArchitecture.All, null)]
public static UIKit.UIColor FromName (string name, Foundation.NSBundle inBundle, UIKit.UITraitCollection compatibleWithTraitCollection);
static member FromName : string * Foundation.NSBundle * UIKit.UITraitCollection -> UIKit.UIColor
Parameters
- name
- String
The name of a color asset.
- compatibleWithTraitCollection
- UITraitCollection
The trait collection that specifies the gamut.
This parameter can be null
.
Returns
- Attributes
Remarks
(More documentation for this node is coming)
This can be used from a background thread.