iOS 下拉视图 [英] iOS drop down view

查看:29
本文介绍了iOS 下拉视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找在用户单击或折叠时基本上展开的下拉视图(展开和折叠视图).

I have been searching for drop down view (expand & collapse view) that basically expand when user clicked on it or collapse.

下拉菜单主要用于包含文本视图/文本字段.直到现在我无法找到如何创建这个下拉视图.我设法找到的是下拉菜单,它有点像一个选项选择器,允许您选择一个选项.我只想包含文本.是否可以就此寻求一些指导?

The drop down is basically use to include textview/textfield. Till now I could not manage to find how to create this drop down view. What I managed to find is drop down menu which is sort of like an option picker that allows you to select an option. I just wanted to include text only. Is it possible to ask for some pointers regarding this?

谢谢.

推荐答案

我还需要一个类似 HTML 选择的控件(单选下拉列表),同时又不破坏过去和未来 iOS 版本中的 XCode 遗留 GUI 界面.

I also needed a HTML select-like control (single-selection dropdown list) without breaking the XCode legacy GUI interface across past and future iOS releases.

我最终编写了 DownPicker,这是一个轻量级控件,它结合了 UITextFieldUIPickerView.它既可以用作自定义控件(UIDownPicker),也可以用作控件包装器,升级任何现有的UITextField.

I ended up coding DownPicker, a lightweight control which does just that combining UITextField and UIPickerView. It can be used either as custom control (UIDownPicker) or also as control wrapper, upgrading any existing UITextField.

这是它的样子:

有关更多信息和下载,您可以查看此简要教程GitHub 项目页面(都是我写的 - 该项目是开源).

For more info and download you can check this brief tutorial or the GitHub project page (both wrote by me - the project is open-source).

这篇关于iOS 下拉视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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