UITraitCollection.FromUserInterfaceStyle(UIUserInterfaceStyle) 方法

定义

创建新的特征集合并将其与指定的用户界面样式相关联。

[Foundation.Export("traitCollectionWithUserInterfaceStyle:")]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.TvOS, 10, 0, ObjCRuntime.PlatformArchitecture.All, null)]
[ObjCRuntime.Introduced(ObjCRuntime.PlatformName.iOS, 12, 0, ObjCRuntime.PlatformArchitecture.All, null)]
[ObjCRuntime.Unavailable(ObjCRuntime.PlatformName.WatchOS, ObjCRuntime.PlatformArchitecture.All, null)]
public static UIKit.UITraitCollection FromUserInterfaceStyle(UIKit.UIUserInterfaceStyle userInterfaceStyle);
static member FromUserInterfaceStyle : UIKit.UIUserInterfaceStyle -> UIKit.UITraitCollection

参数

userInterfaceStyle
UIUserInterfaceStyle

要与新特征集合关联的用户界面样式。

返回

与指定的用户界面样式关联的新特征集合。

属性

适用于