使用 NSUserDefaults 和设置包更改主视图
我在 App Store 上有一款游戏,对于下一个版本,我正在努力在设置中提供使用不同皮肤的选项。举例来说,假设我选择篮球选项。我希望应用程序显示篮球 .xib 而不是默认视图控制器。
我该怎么做呢?大约会有4-5种不同的皮肤。谢谢。
I have a game on the App Store, and for the next version I am working on having an option in the settings to use different skin. So for example, lets say I choose the basketball option. I would want the app to show the basketball .xib instead of the default view controller.
How would I do that? There would be about 4-5 different skins. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我建议以编程方式执行 UI,而不是使用 xib 文件,因为我相信使用 xib 不可能完成您想要的任务。
如果您执意要使用 xib,请创建 5 个相同的子视图集并相应地命名它们,然后在必要时以编程方式隐藏/取消隐藏它们。
当面临仅在代码中自己创建元素的选项时,这似乎更加麻烦且难以管理。
I would suggest doing your UI programmatically and not using a xib file as I believe it is impossible to accomplish what you are after with a xib.
If you are deadset on using a xib, create 5 identical sets of subviews and name them accordingly, then programmatically hide/unhide them when necessary.
This seems much more cumbersome and hard to manage when faced with an option of just creating the elements yourself in code.