Cappuccino theming

37 views
Skip to first unread message

David Hess

unread,
Oct 19, 2011, 11:22:54 AM10/19/11
to objecti...@googlegroups.com

Re: previous discussions about the theming mechanism in Cappuccino....

Did anybody notice that Apple has finally taken a stab at it in UIKit with iOS 5? Seems like a pretty simple but effective approach.

> You can now customize the appearance of many UIKit views and controls to give your application a unique look and feel. For example, you might use these customizations to make the standard system controls match the branding for the rest of your application.
>
> UIKit supports the following customizations:
>
> • You can set the tint color, background image, and title position properties (among other) on a wide variety of objects, including toolbars, navigation bars, search bars, buttons, sliders, and some other controls.
> • You can set attributes of some objects directly, or you can set the default attributes to use for a class using an appearance proxy.
>
> An appearance proxy is an object you use to modify the default appearance of visual objects such as views and bar items. Classes that adopt the UIAppearance protocol support the use of an appearance proxy. To modify the default appearance of such a class, retrieve its proxy object using the appearance class method and call the returned object’s methods to set new default values. A proxy object implements those methods and properties from its proxied class that are tagged with the UI_APPEARANCE_SELECTOR macro. For example, you can use a proxy object to change the default tint color (through the progressTintColor or trackTintColor properties) of theUIProgressView class.
>
> If you want to set a different default appearance based on how a given object is used in your application, you can do so using the proxy object returned by the appearanceWhenContainedIn: method instead. For example, you use this proxy object to set specific default values for a button only when it is contained inside a navigation bar.
>
> Any changes you make with a proxy object are applied, at view layout time, to all instances of the class that exist or that are subsequently created. However, you can still override the proxy defaults later using the methods and properties of a given instance.


Dave

Reply all
Reply to author
Forward
0 new messages