Transferred from: Huifeidexin_1 's Column
Appearance is an Apple protocol on iOS5.0 that makes it easy for programmers to change the global style of a control (background)
@selector (appearance)
Classes that support the Uiappearance protocol can access the appearance selector, which returns appearance proxy for receiver, and I can send some messages to the proxy, such as Settintcolor:
However, it does not support all UI classes. The classes it supports are listed below
1.UIActivitiIndicatorView
2.UIBarButtonItem
3.UIBarItem
4.UINavgationBar
5.UIPopoverControll
6.UIProgressView
7.UISearchBar
8.UISegmentControll
9.UISlider
10.UISwitch
11.UITabBar
12.UITabBarItem
13.UIToolBar
14.UIView
15.UIViewController
For example:
[[Uinavigationbarappearance] settintcolor:[uicolorblackcolor];
[[Uisearchbarappearance] settintcolor:[uicolorblackcolor];
Attention:
Beginners will definitely call the method arbitrarily, most of the methods are invalid if the call throws a unknown selector exception
So how do you see what you call a method that works, and we can see the method that contains the "Ui_appearance_selector" constant in the header file of this class.
such as Uitoolbar
It supports the following methods
@property (nonatomic,retain) uicolor *tintcolor ui_appearance_selector;
-(void) SetBackgroundImage: (UIImage *) backgroundimage fortoolbarposition: (uitoolbarposition) Toporbottom barMetrics :(uibarmetrics) barmetrics Ns_available_ios (5_0) ui_appearance_selector;
-(UIImage *) Backgroundimagefortoolbarposition: (uitoolbarposition) Toporbottom barmetrics: (uibarmetrics) BarMetrics Ns_available_ios (5_0) ui_appearance_selector;
-(void) Setshadowimage: (UIImage *) shadowImage fortoolbarposition: (uitoolbarposition) Toporbottom Ns_available_ios (6 _0) Ui_appearance_selector;
-(UIImage *) Shadowimagefortoolbarposition: (uitoolbarposition) Toporbottom Ns_available_ios (6_0) UI_APPEARANCE_ SELECTOR;
For more information, visit: http://developer.apple.com/library/ios/#documentation/uikit/reference/uiappearance_protocol/reference/ Reference.html
[Go] Set control global display style appearance proxy