Android 键盘弹出字符未显示

Android keyboard popup character not showing

我创建了一个自定义键盘,一切正常,除了当我长按键盘上的键时不显示弹出字符。 您知道要修复它吗,以便弹出字符将作为一个选项出现并且用户可以 select 它们?

<Keyboard ...>
    <Row>
       <Key android:codes="46" android:keyLabel="." android:popupCharacters=","/>
    </Row>
</Keyboard>

这是我按下键盘上的某个键时的样子。弹出字符“,”未显示。

我的预览布局: preview.xml

<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="30dp"
      android:layout_height="40dp"
      android:gravity="center"
      android:background="@drawable/round_preview"
      android:textStyle="bold"
      android:textSize="20sp"
      android:textColor="@color/colorPrimaryDark"/>

谢谢。

好的,我知道问题出在哪里了:

对于 popupCharacter,您需要包含 populLayout

字符:

<Key android:codes="46,63,33" android:keyLabel="."  android:keyWidth="10%p" android:popupCharacters=",?!" android:popupKeyboard="@xml/popup_symbols" />

和popup_symbols.xml布局:

<?xml version="1.0" encoding="utf-8"?>
<Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
      android:keyWidth="10%p"
      android:horizontalGap="0px"
      android:verticalGap="0px"
      android:keyHeight="40dp" >
</Keyboard>