如何为iPhone应用程序创建下拉列表框 [英] How to create drop down list box for an iphone app

查看:92
本文介绍了如何为iPhone应用程序创建下拉列表框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要为iphone应用添加下拉列表框。我在库中找不到这个对象。相反,有选择器视图,但我需要紧凑的对象,如下拉列表框。请建议我如何添加或创建它。

I need to add dropdown list box for an iphone app. I couldn’t find this object in the library. Instead there is picker view, but i need compact object like dropdown list box. Please suggest me how to add or create this.

提前致谢。

推荐答案

不存在这样的事情。您可以创建自己的控件,也可以使用UIPicker。与使用Picker相比,创建自己的下拉控件是相当多的工作,除非该特定控件是关键任务,否则我建议您弄清楚如何在现有设计中使用UIPicker。它不仅已经存在,而且用户熟悉它并知道如何使用它。人机接口指南和一组标准的UI元素确实存在重点。

No such thing exists. You can either create your own control, or use UIPicker. Creating your own drop-down control is quite a bunch of work, compared to using the Picker, and unless that particular control is mission-critical, I'd recommend you figure out how to use UIPicker inside your existing design. Not only does it already exist, but users are familiar with it and know how to use it. There really is a point to Human Interface Guidelines and a standard set of UI elements.

在我需要在少量空间中进行类似拾取器控制的情况下,我使用了一个标签和一个按钮,显示另一个包含选择器的视图。您可以使用UINavigationController进行滑动,或者只是以模态方式显示视图。这就是我主要看到处理这个问题的应用程序。

In situations where I've needed a picker-like control in a small amount of space, I've used a label and a button that brings up another view containing the picker. You can slide that in using UINavigationController, or just present the view modally. That's how I mostly see apps handling this.

编辑:或者像@Lou Franco所说的那样使用UIActionSheet。这也是一个不错的选择。

Or use UIActionSheet like @Lou Franco says. That's a pretty good option too.

这篇关于如何为iPhone应用程序创建下拉列表框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆