以模态方式呈现 UIDatePicker
嘿,我有一个视图,其中有一个按钮,按下该按钮时应以模态方式呈现 UIDatePicker
。我已经正确显示了选择器,但因为它位于其自己的 UIView 上,所以它是全高的,并且看起来很有趣。我想要的只是从用户那里获得真正快速的日期输入,更像是 UIActionSheet 而不是 UIView。
如何使 UIPicker
只向上滑动一半,并在工具栏上执行一些操作,例如完成等?
谢谢
Hey I have a view that has a button that when pressed should modally present a UIDatePicker
. I have the picker showing up properly, but because it is on its own UIView
, it is full height, and looks funny. All I want is to get a really quick date input from the user, more like a UIActionSheet
than a UIView
.
How can I make the UIPicker
slide up modally only halfway and have some actions on a toolbar, like done etc?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以将其放在另一个具有透明背景的 UIView 上,或者更简单地,不要使用 PresentModalViewController,而是编写自己的例程以在当前视图中显示它。
当然,您需要添加所有必要的代码来保留指向选择器的指针,并跟踪何时显示和删除它。
You could put it on another UIView which has a transparent background, or more simply, don't use presentModalViewController, but write your own routine to show it in the current view.
You would of course need to add all the necessary code to keep a pointer to the picker and keep track of when to show and get rid of it.