iPhone UI 设计问题 - 设计表单的最佳方式?
我想设计一个应用程序,需要用户输入一些内容,例如开始日期、结束日期、一堆其他选项和一些文本注释,我计划使用选择器来选择将以模式方式向上滑动的数据。我需要上下移动视图,以确保当选择器和键盘上下滑动时,填充的元素保持焦点。
我的问题是实施这种“形式”的最佳视图是什么?我正在考虑分组表视图,我可以在其中将字段部分分开。
还有其他方法可以实现这些事情吗? 根据经验或最佳实践,是否有更好的替代方案或示例代码或应用程序可供我探索?
开发。
I want to design an app that needs user to input few things like start date, end date, bunch of other options and some text comments for which I am planning to use pickers to select the data that will slide up modally. I will need to move the view up and down to make sure that the element being filled stays in focus when the pickers and keyboard slides up and down.
My question is what would be the best view to implement such a "form"? I was thinking grouped table view where I could separate the fields section wise.
Is there any other way to implement these things?
By experience or best practices, are there any better alternatives or sample code or apps out there that I can explore?
Dev.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
最像 iPhone 的表单界面是分组表格视图。这是大多数用户在使用其他使用分组表视图来添加和编辑结构化数据的应用程序后所期望的。
一个好的做法是为节和节内的行创建一个
enum
(枚举),例如:在本示例中,您可以使用此枚举按名称而不是编号来引用节。
(实际上,您可能不会使用
kFormSectionFirstSection
作为描述性名称,而是使用kFormSectionNameFieldSection
或kFormSectionAddressFieldSection
等,但这应该是希望的说明枚举
的结构。)您将如何使用它?
下面是一些表视图委托方法的示例,演示了它的用途:
这应该快速显示枚举的实用性和强大功能。
代码中的名称比数字更容易阅读。当您处理委托方法时,如果您对节或行有一个很好的描述性名称,则可以更轻松地阅读表视图和单元格的管理逻辑。
如果您想更改部分或行的顺序,您所要做的就是重新排列
enum
构造中枚举标签的顺序。您不需要进入所有委托方法并更改幻数,一旦你有超过几个部分和行,这很快就会变成一种棘手且容易出错的舞蹈。The most iPhone-like interface for forms is going to be a grouped table view. It is what most users will expect, after using other apps which use grouped table views for adding and editing structured data.
A good practice is to create an
enum
(enumeration) for sections and for rows within sections, e.g.:In this example, you can use this enumeration to refer to sections by name instead of number.
(In practice, you probably wouldn't use
kFormSectionFirstSection
as a descriptive name, but something likekFormSectionNameFieldSection
orkFormSectionAddressFieldSection
etc., but this should hopefully illustrate the structure of theenum
.)How would you use this?
Here's an example of a few table view delegate methods which demonstrate how this is useful:
This should quickly show the utility and power of enumerations.
Names in code are much easier to read than numbers. When you're dealing with delegate methods, if you have a good descriptive name for a section or a row, you can more easily read the logic of how the table view and cells are managed.
If you want to change the order of sections or row, all you have to do is rearrange the order of enumerated labels in the
enum
construct. You wouldn't need to go into all the delegate methods and change magic numbers, which quickly becomes a tricky and error-prone dance once you have more than a couple sections and rows.