Android - 数字(浮动)软键盘
我需要在 EditText 中插入一些带小数的数字数据。我知道我可以
android:inputType="numberDecimal"
在我的 xml 文件中插入这个:。但我想要一个只有数字(和点)键的不同键盘。类似于“电话”键盘 (android:inputType="phone"
)。
我知道,这是一个重复的问题(此处 原来的)但我决定打开一个新的,因为第一个看起来没有一个好的解决方案。
I need to insert in an EditText some numeric data with decimal. I know that i could insert this:
android:inputType="numberDecimal"
in my xml file. But I'd like a different keyboard with only numeric (and point) keys. Something like the "phone" keyboard (android:inputType="phone"
).
I know, this is a duplicated question (here the original) but i decided to open a new one because the first one doesn't look to have a good solution.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这取决于您设备上安装的键盘应用程序,哪些按钮对于不同的输入类型可见。由于安全问题,您不能简单地覆盖默认键盘。但您可以创建自己的实现。但需要用户在设置中注册。
具体做法如下:
http://android-developers.blogspot.com/2009/04 /creating-input-method.html
和示例键盘:
http://developer.android.com/resources/samples/SoftKeyboard/index.html
It depends on keyboard app, which is installed on your device, which buttons are visible for different inputTypes. You can't simply override default keyboard due to security issues. But you can create your own implementation. But it needs to be registered by user in settings.
There is how to do it:
http://android-developers.blogspot.com/2009/04/creating-input-method.html
And sample keyboard:
http://developer.android.com/resources/samples/SoftKeyboard/index.html