改变 Iphone UI 组件的外观和感觉
我已经从尝试 Android 转向 iPhone 开发。所以我不仅找不到我要找的东西,而且甚至不知道该主题使用的正确术语,都遇到了很多麻烦。好吧,这就是我正在寻找的,我只需要知道它是否可能,如果可能,就朝正确的方向推动。
我能描述它的最好方式是剥皮。最后这就是我真正需要的。我想要做的是为不同的 ui 元素创建自定义皮肤,例如:自定义按钮空闲和向下图像。
我并不是真的在寻找“技巧”或“解决方法”,我真的只是想知道sdk是否有这个,或者iphone是否支持这样的东西。如果没有,那就太糟糕了,但我可以克服它。
我希望我说得足够清楚,感谢您的帮助。
I've come over from experimenting with android to Iphone development. so i'm having a lot of trouble not only finding what i'm looking for but knowing even the right term to use for this subject. Alright, this is what i'm looking for, i just need to know if it's possible, and if it is, a push in the right direction.
The best way i can describe it is skinning. in the end this is all i really need. What I'd like to be able to do is create a custom skin for different ui elements ex: custom button idle and down image.
I'm not really looking for a "trick" or "work-around", i really just want to know if the sdk has this, or if iphone supports such a thing. If it didn't, bummer but I could get over it.
I hope i'm being clear enough, your aid is appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您正在寻找是否可以更改 UI 元素的单独视觉属性,那么答案是肯定的。
一般来说,要自定义各个 UI 元素,您需要针对每个组件手动执行此操作(或使用界面生成器)。例如,如果您想更改 UIButton 的背景颜色,则需要设置 backgroundColor 属性。
iPhone SDK 并不像您所寻找的那样专门支持换肤(或主题或样式)。
您可以做一些聪明的事情来减少代码,例如在 UIView 上的多个元素上设置背景颜色。但我认为您正在寻找将样式与组件分开的东西,就像 CSS 那样。
在这种情况下,您可能想查看具有“样式”概念的 Three20 项目:
http://third20 .info/overview#Style
If you're looking for whether you can change individual visual attributes of UI elements then the answer is definitely.
In general to customize the individual UI elements you need to do so per component manually (or using interface builder). For example if you want to change the background color of a UIButton you need to set the backgroundColor property.
The iPhone SDK does not specifically supports skinning (or themes or styles) in the way you might be looking for it.
You can do smart things to cut down on code by for instance generically setting backgroundColor on several elements on your UIView. But I think you're looking for something that separates out style from components more like CSS does it.
In that vein you might want to look at the Three20 project which has the notion of "styles":
http://three20.info/overview#Style