如果“Soft”设置为 TimePicker,我如何捕获时间变化?正在使用键盘?
继续以下链接中提到的问题:
如果正在使用键盘,如何捕获 TimePicker 中的时间变化?
我可以解决该问题,但它仅在您使用实际键盘时有效。如果您使用软键盘,我将无法使用它。
我正在使用 1.6 版本的框架进行编程。
任何帮助将不胜感激。
PS:事实上,我到处寻找答案但未能找到它,这告诉我这一定是非常简单或非常复杂。帮助?!
Continuing with the question referred in the following link:
How can I capture when time changes in a TimePicker if the keyboard is being used?
I could solve the problem but it only works when you use the actual keyboard. If you use the soft keyboard I can't get it to work.
I am programming in 1.6 version of the framework.
Any help will be much appreciated.
PS: The fact that I've search everywhere for the answer and have not been able to find it tells me that this must be so very simple or very much complicated. Help?!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
参考 Cody 的评论,您需要在对话框关闭时从 TimePicker 中删除焦点。
您可以使用它,其中 tp 是 TimePicker 实例:
Referring to the comment from Cody, you need to remove focus from the TimePicker when the dialog is closed.
You can use this, where tp is the TimePicker instance:
我也有同样的问题。如果我使用 TimePickerDialog 就没有问题。
对于在 DialogPreference 中使用 TimePicker,这是我做过的最糟糕的解决方法,沿着 TimePicker 的视图层次结构向下:
这样我可以直接访问输入的文本 - 但应该有更好的方法来管理键盘输入...
I've got the same problem. If I use TimePickerDialog there's no problem.
For using TimePicker in a DialogPreference, this is the WORST workaround I've ever made, going down the view hierarchy of the TimePicker:
This way I could access the text directly which was typed in - but there SHOULD be a better way to manage keyboard inputs...
这对我有用:
我发现这个问题只是一个问题,具体取决于您使用的设备。
我有一个三星时刻,所以在其他设备(显然不是全部)和模拟器中进行测试后,我发现这只发生在我的手机上。
以下链接帮助我解决了我的问题。我希望它能帮助你...
http:// blog.xiaad.com/2010/03/android-datepicker-years-before-2000.html
非常高兴!
西蒙尼
This is what worked for me:
I found out that this issue is only an issue depending on the device your working with.
I have a Samsung Moment, so after testing in other devices (obviously not all of them) and emulators I found out it was only happening with my phone.
The following link helped me solve my problem. I hope it helps you...
http://blog.xiaad.com/2010/03/android-datepicker-years-before-2000.html
N-Joy!
Simmone