UIAppearanceContainer Protocol Reference
| Conforms to | |
| Framework | /System/Library/Frameworks/UIKit.framework |
| Availability | Available in iOS 5.0 and later. |
| Declared in | UIAppearance.h |
Overview
A class must adopt the UIAppearance protocol to allow appearance customization using the UIAppearance API.
To participate in the appearance proxy API, tag your appearance property accessor methods in your header with UI_APPEARANCE_SELECTOR.
Appearance property accessor methods must be of the form:
- (PropertyType)propertyForAxis1:(IntegerType)axis1 axis2:(IntegerType)axis2 axisN:(IntegerType)axisN; |
- (void)setProperty:(PropertyType)property forAxis1:(IntegerType)axis1 axis2:(IntegerType)axis2 axisN:(IntegerType)axisN; |
You may have no axes or as many as you like for any property.
The property type may be any standard iOS type: id, NSInteger, NSUInteger, CGFloat, CGPoint, CGSize, CGRect, UIEdgeInsets or UIOffset. Axis parameter values must be either NSInteger or NSUInteger. UIKit throws an exception if other types are used in the axes.
For example, UIBarButtonItem defines these methods:
@property(nonatomic,retain) UIColor *tintColor UI_APPEARANCE_SELECTOR; |
- (UIImage *)backButtonBackgroundImageForState:(UIControlState)state |
barMetrics:(UIBarMetrics)barMetrics UI_APPEARANCE_SELECTOR; |
- (void)setBackButtonBackgroundImage:(UIImage *)backgroundImage |
forState:(UIControlState)state |
barMetrics:(UIBarMetrics)barMetrics UI_APPEARANCE_SELECTOR; |
Constants
Appearance Property Selector Tag
A tag to mark a method that participates in the appearance proxy API.
#define UI_APPEARANCE_SELECTOR
Constants
© 2011 Apple Inc. All Rights Reserved. (Last updated: 2011-10-12)