共用方式為


PKAddPassButton.AppearanceWhenContainedIn(Type[]) 方法

定義

當檢視裝載于指定的階層時,傳回這個類別實例的強型別 UIAppearance。

public static PassKit.PKAddPassButton.PKAddPassButtonAppearance AppearanceWhenContainedIn (params Type[] containers);
static member AppearanceWhenContainedIn : Type[] -> PassKit.PKAddPassButton.PKAddPassButtonAppearance

參數

containers
Type[]

開發人員想要以容器的形式套用此特定外觀的類型清單

傳回

當指定的容器階層為作用中時,開發人員可用來設定屬性的外觀 Proxy 物件

備註

傳回的物件代表 UIAppearance Proxy,當參數所 containers 指定的階層中包含這些實例時,開發人員可以設定 PKAddPassButton 實例的外觀屬性。

如果開發人員想要控制 PKAddPassButton 子類別的外觀,他們應該使用 GetAppearance<T>(UITraitCollection, Type[]) 方法。

下列範例顯示 AppearanceWhenContainedIn 方法的運作方式

var mySliders = UISlider.AppearanceWhenContainedIn (typeof (UINavigationBar), typeof (UIPopoverController));
mySliders.TintColor = UIColor.Red;

如需詳細資訊,請參閱 類別 UIAppearance 的檔。

適用於