是否有用于在 iPhone 应用程序中设置首选项的库或框架?
在 iPhone 上使用 Settings.app 并不难。 事实上,Xcode 为您完成了大部分工作。 只需将 Settings.bundle 添加到您的项目中,您几乎无需花费任何费用即可获得它。
目前我正在为 iPhone 开发一个应用程序,它要求用户填写几个“表单”,主要是键值对、一些滑块和几个带有“下拉”菜单的模式视图。 该任务与 Settings.app 的功能非常相似。
在我看来,自己做表格是一项繁重的任务,所以我想知道是否有一个框架来完成此类任务。 不幸的是,苹果似乎没有提供自己的解决方案。 也许有人知道网络上描述最佳实践的框架或文章。
如果您不明白我指的是哪种模式,我做了一个屏幕截图: http: //img.skitch.com/20090625-s8bf6ahybwe3cesd1id38h3nt.jpg
Using the Settings.app on the iPhone isn't that hard. In fact Xcode does the most of the work for you. Just add the Settings.bundle to your project and there you have it for nearly no cost.
At the moment I'm developing an application for the iPhone which requires the user to fill out several "forms", mostly key-value pairs, some sliders and several modal views with "dropdown" menus. So similar the task is similar to what the Settings.app does.
Doing the forms by myself is a heavy task in my opinion, so I'm wonding if there's a framework for this kind of tasks. Unfortunately it looks like Apple doesn't provide it's own solution. Perhaps somebody knows of a framework or an article on the web which describes best practices.
In case you don't understand to which pattern I'm referring, I made a screenshot: http://img.skitch.com/20090625-s8bf6ahybwe3cesd1id38h3nt.jpg
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
请查看 http://www.inappsettingskit.com。 它在几个应用程序中使用,并且得到积极维护(由我自己和其他一些人)。
Check out http://www.inappsettingskit.com. It's used in a couple of apps and it's actively maintained (by myself and a bunch of others).
经过大量研究后,我未能为我最初的问题找到一个好的答案。 但现在我在 github 上偶然发现了这个存储库: mySettings
After much research I didn't manage to get a good answer to my initial question. But by now I stumbled over this repository on github: mySettings
最好将设置放在应用程序中,至少在苹果可以轻松地将用户发送到“设置”然后返回到应用程序之前是这样。 如果您查看新的 3.0 UITableViewCellStyles,会发现有一种专门用于设置单元格类型的样式 - 它将使构建简单的设置屏幕变得非常容易。
It's better to put settings in the app, at least until Apple makes it easy to send the user out to Settings and then back into the app. If you look at the new 3.0 UITableViewCellStyles, there's one style tailor-made to doing settings kind of cells - it would make it pretty easy to build out a simple settings screen.
好吧,如果您正在进行设置,那么我建议将它们放在正确的位置并使用 Settings.bundle。
我猜你正在做设置,尽管这对你的应用程序非常重要,如果他们不得不不断地从应用程序跳转到设置并再次返回,那将是一种可怕的用户体验。
当你说做这项任务很繁重时——你能详细说明一下吗——因为我已经完成了,而且并不繁重。
UITableViewController
对您想要使用的每个单元格使用类似于以下代码的
:这对我来说可以重现您正在谈论的界面 - 这里的示例是 TextField - 但相同的代码对于所有控件都运行得很好。
Well if you are doing settings then I would suggest putting them in the correct place and using the Settings.bundle.
I guess you are doing settings though that are highly important to you app and it would be a horrible user experience if they had to keep jumping from the app to settings and back again.
When you say doing the task is heavy - can you elaborate - as I have done it and it has not been heavy.
Use a UITableViewController
for each cell that you want to use put in code similar to:
This has worked for me to reproduce the interface you are talking about - the example here is a TextField - but the same code has worked very well with all controls.
我非常确定他要求的是一个从 settings.bundle 文件重新创建设置界面的框架,以便在设置应用程序和您的应用程序中都可以进行设置。
我还不知道类似的东西,但是,我真的可以使用一个,并且我已经考虑过写一个。
I am pretty sure what he is asking for is a framework that recreates the settings interface from the settings.bundle file so that there can be settings both in the settings app and within your app.
I don't yet know of anything like that but, I could really use one and I have considered writing one.