共用方式為


UIBarButtonItem.GetAppearance 方法

定義

多載

GetAppearance(UITraitCollection)

傳回指定 traits 的外觀 Proxy。

GetAppearance(UITraitCollection, Type[])

傳回在內含專案階層中找到 containers 時所指定 traits 的外觀 Proxy。

GetAppearance<T>(UITraitCollection, Type[])

取得 UIBarButtonItem 子類別的外觀 Proxy UIBarButtonItem.UIBarButtonItemAppearance ,當檢視裝載于指定的階層時,具有指定的特徵集合。

GetAppearance<T>()

取得 UIBarButtonItem 子類別的外觀 Proxy UIBarButtonItem.UIBarButtonItemAppearance

GetAppearance<T>(UITraitCollection)

取得 UIBarButtonItem 子類別的外觀 Proxy UIBarButtonItem.UIBarButtonItemAppearance

GetAppearance(UITraitCollection)

傳回指定 traits 的外觀 Proxy。

public static UIKit.UIBarButtonItem.UIBarButtonItemAppearance GetAppearance (UIKit.UITraitCollection traits);
static member GetAppearance : UIKit.UITraitCollection -> UIKit.UIBarButtonItem.UIBarButtonItemAppearance

參數

傳回

適用於

GetAppearance(UITraitCollection, Type[])

傳回在內含專案階層中找到 containers 時所指定 traits 的外觀 Proxy。

public static UIKit.UIBarButtonItem.UIBarButtonItemAppearance GetAppearance (UIKit.UITraitCollection traits, params Type[] containers);
static member GetAppearance : UIKit.UITraitCollection * Type[] -> UIKit.UIBarButtonItem.UIBarButtonItemAppearance

參數

containers
Type[]

傳回

適用於

GetAppearance<T>(UITraitCollection, Type[])

取得 UIBarButtonItem 子類別的外觀 Proxy UIBarButtonItem.UIBarButtonItemAppearance ,當檢視裝載于指定的階層時,具有指定的特徵集合。

public static UIKit.UIBarButtonItem.UIBarButtonItemAppearance GetAppearance<T> (UIKit.UITraitCollection traits, params Type[] containers) where T : UIKit.UIBarButtonItem;
static member GetAppearance : UIKit.UITraitCollection * Type[] -> UIKit.UIBarButtonItem.UIBarButtonItemAppearance (requires 'T :> UIKit.UIBarButtonItem)

類型參數

T

必須傳回 UIAppearance Proxy 的類型。 這是 UIBarButtonItem 的子類別。

參數

traits
UITraitCollection

要比對的特徵集合。

containers
Type[]

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

傳回

指定型別的外觀 Proxy 物件。

備註

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

Appearance不同于 屬性,或 AppearanceWhenContainedIn(Type[]) 只處理這個特定類別實例的方法,GetAppearance 所傳回的 Proxy 可用來變更子類別的樣式。

下列範例示範 GetAppearance 方法的運作方式

var myTheme = UIBarButtonItem.GetAppearance<MyUIBarButtonItemSubclass> (myTraits, typeof (UINavigationBar), typeof (UIPopoverController));
myTheme.TintColor = UIColor.Red;

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

適用於

GetAppearance<T>()

取得 UIBarButtonItem 子類別的外觀 Proxy UIBarButtonItem.UIBarButtonItemAppearance

public static UIKit.UIBarButtonItem.UIBarButtonItemAppearance GetAppearance<T> () where T : UIKit.UIBarButtonItem;
static member GetAppearance : unit -> UIKit.UIBarButtonItem.UIBarButtonItemAppearance (requires 'T :> UIKit.UIBarButtonItem)

類型參數

T

必須傳回 UIAppearance Proxy 的類型。 這是 UIBarButtonItem 的子類別。

傳回

指定型別的外觀 Proxy 物件。

備註

在傳回的物件上設定任何外觀屬性會影響類型參數的所有類別和子類別的外觀。

Appearance不同于 屬性,或 AppearanceWhenContainedIn(Type[]) 只處理這個特定類別實例的方法,GetAppearance 所傳回的 Proxy 可用來變更子類別的樣式。

下列範例示範 GetAppearance 方法的運作方式

var myTheme = UIBarButtonItem.GetAppearance<MyUIBarButtonItemSubclass> ();
myTheme.TintColor = UIColor.Red;

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

適用於

GetAppearance<T>(UITraitCollection)

取得 UIBarButtonItem 子類別的外觀 Proxy UIBarButtonItem.UIBarButtonItemAppearance

public static UIKit.UIBarButtonItem.UIBarButtonItemAppearance GetAppearance<T> (UIKit.UITraitCollection traits) where T : UIKit.UIBarButtonItem;
static member GetAppearance : UIKit.UITraitCollection -> UIKit.UIBarButtonItem.UIBarButtonItemAppearance (requires 'T :> UIKit.UIBarButtonItem)

類型參數

T

必須傳回 UIAppearance Proxy 的類型。 這是 UIBarButtonItem 的子類別。

參數

traits
UITraitCollection

要比對的特徵集合。

傳回

指定型別的外觀 Proxy 物件。

備註

傳回的物件代表 UIAppearance Proxy,開發人員可以在其中設定 UIBarButtonItem 實例的外觀屬性。

Appearance不同于 屬性,或 AppearanceWhenContainedIn(Type[]) 只處理這個特定類別實例的方法,GetAppearance 所傳回的 Proxy 可用來變更子類別的樣式。

下列範例示範 GetAppearance 方法的運作方式

var myTheme = UIBarButtonItem.GetAppearance<MyUIBarButtonItemSubclass> (myTraits, );
myTheme.TintColor = UIColor.Red;

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

適用於