Appearance Proxies & Layers
问题 Is it possible to use iOS 5 appearance proxies to refactor code that sets properties on layers? _button.layer.cornerRadius = 5.0f; _button.layer.borderWidth = 1.0f; _button.layer.borderColor = [[UIColor blackColor] CGColor]; _button.layer.masksToBounds = YES; 回答1: Nope.. Apple's says: To support appearance customization, a class must conform to the UIAppearanceContainer protocol and relevant accessor methods must be marked with UI_APPEARANCE_SELECTOR. http://developer.apple.com/library/ios/