iPhone/iOS 应用程序中选择器的替代品?

发布于 2024-12-27 17:13:14 字数 122 浏览 1 评论 0原文

我正在显示用户在我的 iPhone 应用程序中填写的表格。其中一个字段是一组 2 或 3 个日期,用户必须从中选择一个。为此放置一个选择器或调出一个表格视图会占用太多空间,而没有为其他字段留下空间。有没有更简单的方法来做到这一点?

I am showing a form the user fills in my iPhone app. One of the fields is a set of 2 or 3 dates from which the user has to pick one. Putting a picker, or bringing up a table view just for this takes up too much space, leaving no room for the other fields. Is there any simpler way to do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

满地尘埃落定 2025-01-03 17:13:14

为此,您可以放置​​两个或三个带箭头的标签,其中包含“选择日期”等文本,单击它后,您可以显示一个允许用户选择日期的视图;一旦选择,您可以返回到原始视图。您可以对所有三个(或两个)日期执行此操作,并在表单视图上获取这些日期。

我正在向您介绍如何设计应用程序;如果您想要代码,我也可以提供帮助,但从您的问题来看,您似乎想要设计想法。

To do this you can put two or three arrowed label with text like "Select Date" upon click of it you can show one view that allow user to select the date; once selected you can back to the original view. You can do this for all three (or two) dates and get those date on form view.

I am giving you idea of how you can design apps; if you want code i can assist that too but from your question it seems you want design ideas.

浮生面具三千个 2025-01-03 17:13:14

您可以使用自定义下拉/组合框,但它们没有内置功能。
苹果 HIG 指南中还提到了以下内容,您也需要考虑这些 -
(http://developer.apple.com/library/IOs/#documentation/UserExperience/Conceptual/MobileHIG/UIElementGuidelines/UIElementGuidelines.html)

指南

使用选择器可以让人们轻松地从一组值中进行选择。当人们熟悉整套值时,通常最好使用选择器。这是因为当车轮静止时,许多(如果不是大多数)值被隐藏。如果您需要提供大量用户不熟悉的选项,选择器可能不是合适的控件。

如果需要显示大量值,请考虑使用表视图而不是选择器。这是因为表视图的高度越大,滚动速度越快。

使用半透明选择栏显示上下文信息,例如测量单位。请勿在拾取器上方或轮子本身上显示此类标签。

在 iPad 上,仅在弹出窗口中显示选择器。选择器不适合主屏幕。

You can go for your custom drop down/combo box, but their is no inbuilt functionality present for this.
Also following is mentioned in apple HIG guideline, you need to consider those as well-
(http://developer.apple.com/library/IOs/#documentation/UserExperience/Conceptual/MobileHIG/UIElementGuidelines/UIElementGuidelines.html)

Guidelines

Use a picker to make it easy for people to choose from a set of values. It’s often best to use a picker when people are familiar with the entire set of values. This is because many, if not most, of the values are hidden when the wheel is stationary. If you need to provide a large set of choices that aren’t well known to your users, a picker might not be the appropriate control.

Consider using a table view, instead of a picker, if you need to display a very large number of values. This is because the greater height of a table view makes scrolling faster.

Use the translucent selection bar to display contextual information, such as a unit of measurement. Do not display such labels above the picker or on the wheel itself.

On iPad, present a picker only within a popover. A picker is not suitable for the main screen.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文