禁用UIPickerView [英] Disable UIPickerView

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

问题描述

有没有办法让UIPickerView只能读取?这意味着用户无法翻阅选项。

Is there a way to make the UIPickerView only Read Only? This means that the user cannot flip through the options.

PS。这与在 didSelectRow 方法中不传递任何内容不同,因为我只希望用户看到选择器在那里而不是触摸它。

PS. This is not the same as not passing anything in the didSelectRow method because I only want the user to see that the picker is there and not to touch it.

推荐答案

将选择器的 userInteractionEnabled 设置为NO。

Set the picker's userInteractionEnabled to NO.

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

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