使用 Pickerview 而不是键盘的 TextInput 字段
我想为特定文本字段添加选取器视图而不是键盘,并直接在 .m 文件中使用内容填充选取器视图
实现此目的最简单的方法是什么?
我可以直接在界面生成器中执行此操作还是必须自己添加大量代码?
I want to add a pickerview instead of a keyboard for a specific textfield and fill the picker view with content directly in the .m file
What is the easiest way to accomplish that?
Can I do this directly in the interface builder or do i have to add much code on my own?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
对于任何 Xamarin.iOS 开发人员,以下是如何使用 C# 进行操作
For any Xamarin.iOS developers, here's how to do it in C#
您可以在 uitextfield 上使用自定义按钮。并可以在按下该按钮时触发操作。
当 pickerview 关闭时,只需在文本框中添加选定的文本。
You can use custom button on uitextfield. and can fire action for that button is pressed.
when pickerview dismiss then just add the selected text in textbox.
将标签设置为该文本字段并检查 textFieldDidBeginEditing 方法中的条件编写选择器代码。
Set tag to that textField and check condition in textFieldDidBeginEditing method write picker code.
或将按钮放在适当的位置,textfield 根据它给出不动作。
or Put Button over in place textfeild give inaction according to it.