在Android TimePicker禁用键盘输入 [英] Disable keyboard input on Android TimePicker
问题描述
我开发并使用1.6 SDK的Android应用程序。我使用的是 TimePicker
,我不想软键盘来了,当你点击了 TimePicker $ C位$ C>。我只希望
TimePicker
使用加号和减号按钮来改变。我已经使用 Android的尝试:作为焦点=假
和安卓focusableInTouchMode =假
希望那些会做,但他们似乎并没有做任何事情。有没有办法做到这一点?
I'm developing and Android app using the 1.6 SDK. I'm using a TimePicker
and I don't want the soft keyboard to come up when you click on the digits in the TimePicker
. I only want the TimePicker
to be changed using the plus and minus buttons. I've tried using android:focusable="false"
and android:focusableInTouchMode="false"
hoping those would do it, but they didn't seem to do anything. Is there a way to do this?
推荐答案
尝试使用:
myTimePicker.setDescendantFocusability(TimePicker.FOCUS_BLOCK_DESCENDANTS);
禁用注重文本视图内部NumberPickers的
to disable focus on the text views of the internal NumberPickers
这篇关于在Android TimePicker禁用键盘输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!