带有presentModalViewController的ios uidatepicker
我需要显示一个带有 uidatepicker 的视图。 我尝试使用presentModalViewcontroller,但使用uidatepicker正确显示了我的新视图控制器,但覆盖了所有iphone,我希望uidatepicker将显示在屏幕的底部...
提前致谢
I need to show a view with a uidatepicker inside..
I tried with presentModalViewcontroller, but shows correctly my new viewcontroller with the uidatepicker, but cover all the iphone, and I wish that the uidatepicker will be shown on the bottom part of the screen...
thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不要为此使用模态视图控制器 - 选择器是单个视图,并且应该是它应该在其中编辑内容的任何视图控制器的视图层次结构的一部分。只需将其放置在屏幕底部即可,然后在需要时将其动画化(在文档中查找 UIView 动画)到屏幕上的位置。
Don't use a modal view controller for that—the picker is a single view, and should be part of the view hierarchy of whatever view controller it's supposed to be editing something in. Just position it so it's off the screen to the bottom, then animate it in (look up
UIView
animations in the docs) to a position onscreen when you need it.