天下之事常成于困约,而败于奢靡。这篇文章主要讲述Android自定义键盘出现一半相关的知识,希望能为你提供帮助。
键盘显示已满,但由于某些原因,最后两行被隐藏。我试图从XML更改键盘高度,但它没有帮助。
文章图片
键盘布局:
<
?xml version="1.0" encoding="utf-8"?>
<
Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
android:keyHeight="@dimen/key_height"
android:keyWidth="10%p"
android:verticalGap="10px">
<
Row>
<
Key
android:keyEdgeFlags="left"
android:keyLabel="q"
android:popupCharacters="1"
android:popupKeyboard="@xml/popup_keyboard" />
<
Key
android:keyLabel="w"
android:popupCharacters="2"
android:popupKeyboard="@xml/popup_keyboard" />
<
Key
android:keyLabel="e"
android:popupCharacters="3?èéê"
android:popupKeyboard="@xml/popup_keyboard" />
<
Key
android:keyLabel="r"
android:popupCharacters="4"
android:popupKeyboard="@xml/popup_keyboard" />
<
Key
android:keyLabel="t"
android:popupCharacters="5"
android:popupKeyboard="@xml/popup_keyboard" />
<
Key
android:keyLabel="y"
android:popupCharacters="6"
android:popupKeyboard="@xml/popup_keyboard" />
<
Key
android:keyLabel="u"
android:popupCharacters="7úù?ū"
android:popupKeyboard="@xml/popup_keyboard" />
<
Key
android:keyLabel="i"
android:popupCharacters="8"
android:popupKeyboard="@xml/popup_keyboard" />
<
Key
android:keyLabel="o"
android:popupCharacters="9??óō"
android:popupKeyboard="@xml/popup_keyboard" />
<
Key
android:keyEdgeFlags="right"
android:keyLabel="p"
android:popupCharacters="0"
android:popupKeyboard="@xml/popup_keyboard" />
<
/Row>
<
Row>
<
Key
android:horizontalGap="4%p"
android:keyEdgeFlags="left"
android:keyLabel="a"
android:popupCharacters="?á??ā???"
android:popupKeyboard="@xml/popup_keyboard" />
<
Key
android:keyLabel="s"
android:popupCharacters="?"
android:popupKeyboard="@xml/popup_keyboard" />
<
Key android:keyLabel="d" />
<
Key android:keyLabel="f" />
<
Key android:keyLabel="g" />
<
Key android:keyLabel="h" />
<
Key android:keyLabel="j" />
<
Key android:keyLabel="k" />
<
Key
android:keyEdgeFlags="right"
android:keyLabel="l" />
<
/Row>
<
Row>
<
Key
android:codes="-1"
android:isModifier="true"
android:isSticky="true"
android:keyEdgeFlags="left"
android:keyIcon="@drawable/ic_shift_24dp"
android:keyWidth="15%p" />
<
Key android:keyLabel="z" />
<
Key android:keyLabel="x" />
<
Key
android:keyLabel="c"
android:popupCharacters="?"
android:popupKeyboard="@xml/popup_keyboard" />
<
Key android:keyLabel="v" />
<
Key android:keyLabel="b" />
<
Key
android:keyLabel="n"
android:popupCharacters="?"
android:popupKeyboard="@xml/popup_keyboard" />
<
Key android:keyLabel="m" />
<
Key
android:codes="-5"
android:isRepeatable="true"
android:keyEdgeFlags="right"
android:keyIcon="@drawable/ic_backspace_24dp"
android:keyWidth="15%p" />
<
/Row>
<
Row android:rowEdgeFlags="bottom">
<
Key
android:codes="-2"
android:keyEdgeFlags="left"
android:keyLabel="?123"
android:keyWidth="15%p" />
<
Key
android:codes="-10000"
android:keyIcon="@drawable/ic_insert_emoticon_24dp" />
<
!--
android:codes: -101 is not a framework-defined key code but a key code that is
privately defined in com.example.android.softkeyboard.LatinKeyboardView.
-->
<
Key
android:codes="-101"
android:keyIcon="@drawable/ic_language_24dp" />
<
Key
android:codes="32"
android:isRepeatable="true"
android:keyIcon="@drawable/ic_space_24dp"
android:keyWidth="35%p" />
<
Key
android:keyLabel="."
android:keyWidth="15%p"
android:popupKeyboard="@xml/popup_symbols" />
<
Key
android:codes="10"
android:keyEdgeFlags="right"
android:keyIcon="@drawable/ic_next_circle_filled_24dp"
android:keyWidth="15%p" />
<
/Row>
<
/Keyboard>
答案检查日志后,我发现以下错误:
E / Keyboard:解析错误:android.content.res.Resources $ NotFoundException:来自可绘制资源ID的文件res / drawable / ic_backspace_24dp.xml【Android自定义键盘出现一半】我替换了文件,一切都恢复正常。
0x7f0703ae
推荐阅读
- Android EditText imeOptions使actionSearch像actionDone一样()
- Eclipse Android SDK错误(未知的虚拟设备名称)
- 从Iphone本机客户端通过Google App Engine进行身份验证
- 如何使用C#.NET以编程方式清除回收站
- 如何使用C#从Windows播放,暂停音乐或转到下一首和上一首曲目(适用于所有Windows音乐播放器)
- 如何下载github存储库的单个文件夹
- XML文档中的![CDATA []]节点有什么作用
- 如何在Windows中使用命令提示符执行symfony 3命令
- 如何解决Windows的git(Powershell和GitHub应用程序)中的”文件名过长”错误