如何在 PickerView 顶部添加按钮以及如何在单击该按钮时关闭 PickerView?
我有一个 UIPickerView。我想要在选择器视图顶部有一个完成按钮,并且我想在单击完成按钮时关闭选择器视图。你能帮我解决这个问题吗?
I have a UIPickerView. I want a done button on top of the pickerview and i want to dismiss the picker view on click of the done button. Can u please help me on this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以使用工具栏来达到相同的目的。查看此链接 。这里,考虑相同的解决方案。希望这可以帮助你。谢谢。
You can use the toolbar for the same purpose. Take a look at this link. Here, the same solution is taken into consideration. Hope that may help you. Thanks.
每个主体都采用操作表,然后添加栏按钮,但只是从视图中添加 uibutton 并采取方法从超级视图中删除。显示以下示例,我尝试此代码成功。我认为这是非常有用的代码,无需使用操作表
every body took the action sheet and then added the bar button ,but simply added uibutton from the view and take method remove from the super view. show the bellow example , i am tried this code successful. i think this is very useful code with out using action sheet