如何让 UIDatePicker 出现在屏幕底部? [英] How to make a UIDatePicker appear at bottom of screen?

查看:38
本文介绍了如何让 UIDatePicker 出现在屏幕底部?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前使用 MonoTouch 和 MonoTouch.Dialog.当点击日期字段时,它会推动导航控制器,因此您可以向右转到屏幕以查看您的 UIDatePicker,您可以在其中选择日期,然后再次返回"到主屏幕.我真的很想拥有这个用户界面,就像我使用过的其他应用程序一样,当你选择一个日期字段时,UIDatePicker 会出现在当前屏幕的底部.

I currently use MonoTouch with MonoTouch.Dialog. When tapping on a date field it pushes the navigationcontroller so you go right a screen to see your UIDatePicker where you choose the date then go "back" to the main screen again. I'd really like to have this UI like other apps I've used that when you select a date field the UIDatePicker appears at the bottom of the current screen.

我想了解如何执行此操作并将其应用于其他输入字段,在这些字段中,我可能希望使用自定义选择器,该选择器也显示在当前屏幕的底部.

I would like to learn how to do this and apply it to other input fields where I may want to use a custom picker that also presents itself at the bottom of the current screen.

有没有人有任何代码可以共享,允许 UIPicker/UIDatePicker 出现在活动屏幕的底部?

Does anyone have any code to share that would allow a UIPicker/UIDatePicker to appear at the bottom of the active screen?

谢谢.

推荐答案

您只需正常创建 UIPickerView,但将其框架设置在可见区域之外.单击单元格后,您会更改 UIPickerView 框架的原点,以便选择器视图可见.您可以为属性框设置动画,这样您就可以制作一个漂亮的软动画,您的选择器视图将从手机的下边界滑入.

You just create a UIPickerView normally, but set its frame outside of the visible area. Once you click on a cell, you change the origin point of the UIPickerView's frame, so that the picker view will become visible. You can animate the property frame, so you can make a nice soft animation that your picker view will slide in from the lower boundary of the phone.

这篇关于如何让 UIDatePicker 出现在屏幕底部?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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