在Android TimePicker禁用键盘输入 [英] Disable keyboard input on Android TimePicker

查看:543
本文介绍了在Android TimePicker禁用键盘输入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发并使用1.6 SDK的Andr​​oid应用程序。我使用的是 TimePicker ,我不想软键盘来了,当你点击了 TimePicker 。我只希望 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屋!

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