开发者

UIPickerView vs. a new UITableViewController

开发者 https://www.devze.com 2023-04-12 14:29 出处:网络
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?

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?

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)?

IMO the second alternative is better because:

(1) You get a glance of more options at the same time.

(2) Picking an item can be faster - just touching the screen, no need to scroll in many cases.

(3) UIPickerViews tend (at least for me) to scroll more than I want, which causes a frustrating back-and-forth movement :-)

But still I see many more implementations of 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).


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. I use tables as multi-selects as well, with check-marks as you suggest.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号