[Go] Set control global display style appearance proxy

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.