iOS:适用于iOS应用的样式表/主题 [英] iOS: Stylesheet/Theme for iOS app

查看:64
本文介绍了iOS:适用于iOS应用的样式表/主题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我的一个应用程序,如果客户端发出请求(我通常是品牌应用程序,通常会这样做),则我现在允许自定义主题。有时,这可能只是简单地更改配色方案那样简单,所以我想知道是否存在一种简化流程的方法。例如,如果我有一个名为ColourStyle的类,并且指定了它的color属性值,然后将其导入到其他类中,我可以简单地对其进行设置,以便我要做的就是编辑该类,而其他类将自然地根据其颜色进行设置。

For one of my apps I currently allow for custom themes if the client makes a request (which they usually do, as it's a branded application). Sometimes this can be as simple as simply changing the colour scheme so I was wondering if there was a way to simplify the process. For example, if I had a class named ColourStyle and I specified its colour property values and then imported it to other classes, could I simply set it up so all I have to do is edit this one class and the others will naturally base their colours on whatever value is set in ColourStyle?

这是否可行,还是有更简单的方法?

Would this be feasible, or is there a much easier way?

推荐答案

做到这一点的方法之一是改编新的Appearance API。
http:// developer。 apple.com/library/ios/#documentation/uikit/reference/UIAppearance_Protocol/Reference/Reference.html

One of the ways of doing this is that you adapt the new Appearance API. http://developer.apple.com/library/ios/#documentation/uikit/reference/UIAppearance_Protocol/Reference/Reference.html

如果这方面有很好的讨论和幻灯片,您登录到苹果的开发人员门户;
搜索高级ui定制。

There's a good talk and slides about this if you log in to the apple's developer portal; Search for advanced ui customization.

这篇关于iOS:适用于iOS应用的样式表/主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆