如何在默认的Android键盘上增加一行额外的键? [英] How can I add one extra row of key to the default android keyboard?

查看:255
本文介绍了如何在默认的Android键盘上增加一行额外的键?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用自定义键盘,但无法实现我想要的功能.

I have been messing around with custom keyboards but cannot achieve what I want.

我尝试遵循各种教程(如本教程如何实现特殊的教程软键盘),但由于总是缺少某些部分,因此无法构建自己的键盘.

I tried to follow various tutorials (like this one How can I implement special soft keyboard) but could not build my own keyboard since there is always missing some part.

我还尝试了API 10示例随附的示例SoftKeyboard,但是布局不适合我的应用.

I also tried the sample SoftKeyboard that comes with the API 10 samples but the layout did not suit my app.

现在,我要拥有的是默认的android 4.3软键盘,而不是在左下角提供切换到数字视图的选项(我指的是?123按钮),而是添加另一行到顶部的键.该行应包含键"0"至"9".

Now, all I want to have is a the default android 4.3 softkeyboard, that instead of giving the option to switch to the numeric view in the bottom left corner (I am referring to the ?123button) , adds another row of keys to the top. That row should hold the keys '0' to '9'.

有人可以在这里帮助我吗?我真的很感激!

Can someone help me out here? I would really appreciate it!

推荐答案

无法向android默认键盘添加额外的行,因此您必须转到自定义键盘.自定义键盘在这里理解起来并不难android自定义键盘的最佳示例.

Adding extra row to the android default keyboard is not possible for this you have to go to the custom keyboard..Custom keyboard is not much difficult to understand here is the best example of android custom keyboards..

1.自定义键盘示例1

2.自定义键盘示例2

一旦转到res/xml文件夹中的xml文件并定义键即可..并且没有键盘的行和列.

Once go to the xml file in the res/xml folder and define keys whatever you want..and no of rows and columns for keyboard..

在布局中定义键盘视图集android:keyBackground="@drawable/keyboardview_selector"的颜色,以任何您想要的颜色..

In your layout definig the keyboardview set android:keyBackground="@drawable/keyboardview_selector" color whatever you want..

 <android.inputmethodservice.KeyboardView
            android:id="@+id/keyboardview"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_marginBottom="10dp"
            android:background="@android:color/transparent"
            android:focusable="true"
            android:focusableInTouchMode="true"
            android:keyBackground="@drawable/keyboardview_selector" />

这篇关于如何在默认的Android键盘上增加一行额外的键?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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