简体   繁体   English

UIPickerView与新的UITableViewController

[英]UIPickerView vs. a new UITableViewController

What do you think is a better method for letting a user choose an item from a list with an unknown but rather small (5-20) number of items? 您认为让用户从列表中选择项目的更好方法是什么?这个项目具有未知但很小(5-20​​)的项目数量?

Should I use a UIPickerView on the current screen, or should I push a new UITableViewController and use a Checkmark to indicate the selected item (popping the controller back automatically when a selection is made)? 我应该在当前屏幕上使用UIPickerView,还是应该推送一个新的UITableViewController并使用Checkmark来指示所选项目(在做出选择时自动弹回控制器)?

IMO the second alternative is better because: IMO第二种选择更好,因为:

(1) You get a glance of more options at the same time. (1)您可以同时浏览更多选项。

(2) Picking an item can be faster - just touching the screen, no need to scroll in many cases. (2)拾取项目可以更快 - 只需触摸屏幕,在许多情况下无需滚动。

(3) UIPickerViews tend (at least for me) to scroll more than I want, which causes a frustrating back-and-forth movement :-) (3)UIPickerViews倾向于(至少对我而言)滚动超过我想要的,这导致令人沮丧的来回移动:-)

But still I see many more implementations of UIPickerView. 但我仍然看到更多的UIPickerView实现。

Table has one flaw: as you said, you need to PUSH the view controller onto the screen. 表有一个缺陷:如你所说,你需要将视图控制器推到屏幕上。 So, you are navigating a user away from its current set of data. 因此,您将导航用户远离其当前数据集。 As a result, user cannot see anything except the list with options. 因此,除了带有选项的列表外,用户无法看到任何内容。 So, I would say picker is a better solution if you have more than one set of data on the screen (eg. in a form). 因此,如果您在屏幕上有多组数据(例如,在表单中),我会说选择器是更好的解决方案。 Making user to navigate from the form more than once could be very confusing. 让用户不止一次从表单导航可能会非常混乱。 TableViewController is a better solution if you have a large set of options and if you are presenting it only once (or twice). 如果您有大量选项,并且只呈现一次(或两次),则TableViewController是一种更好的解决方案。

It really depends on the data. 这实际上取决于数据。 If it really can all fit on one screen or if you are adding a search box, I agree that the table can be a better solution. 如果它真的可以放在一个屏幕上,或者如果你要添加一个搜索框,我同意该表可以是一个更好的解决方案。 I use both methods for different data. 我将这两种方法用于不同的数据。 Something that is very sequential, like a time duration with increments of 5 minutes, seems to do better with a picker, especially if it could use multiple wheels. 一个非常顺序的东西,比如一个增量为5分钟的持续时间,对于一个选择器似乎做得更好,特别是如果它可以使用多个轮子。 I use tables as multi-selects as well, with check-marks as you suggest. 我也使用表作为多选,并按照你的建议使用复选标记。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM