本文介绍了从UIPickerView删除未选择的项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理一个带有多个 UIPickerViews 的笔尖文件,如下所示,它非常拥挤。我基本上想使其干净并删除所有灰色项目,而仅显示所选项目。如果您有什么想法可以使页面更整洁,请分享一下,这更多是 UI 问题,而不是逻辑或代码问题。

I'm working on a nib file that has multiple UIPickerViews on it and as you can see below, it is extremely crowded. I basically want to make it clean and remove all of the "gray" items and just show the selected item. If you have any ideas that would make the page cleaner please share, this is more of a UI problem than a logic or code problem. Thanks in advance.

推荐答案

您无需在其中添加 UIPickerView 。您只需添加文本字段,然后将 UIPickerView 设置为文本字段的输入附件视图。因此,您的选择器将出现在底部,并且可以使用委托方法在文本字段中显示选择器的选定值。

You dont need to add UIPickerView in there. You just add text field and set your UIPickerView as text field's input accessory view. So your picker will appear in the bottom side and you can display the selected values of picker in the text field by using delegate methods.

这篇关于从UIPickerView删除未选择的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-21 08:40