【问题标题】:Android keyboard popup character not showingAndroid键盘弹出字符未显示
【发布时间】:2015-10-06 22:18:56
【问题描述】:

我已经创建了一个自定义键盘,除了长按键盘上的键时没有显示的弹出字符外,一切正常。 你知道修复它,以便弹出字符作为选项出现并且用户可以选择它们吗?

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

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

我的预览布局: 预览.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"/>

谢谢。

【问题讨论】:

    标签: android xml keyboard popup character


    【解决方案1】:

    好的,我发现了问题所在:

    对于 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>
    

    【讨论】:

      猜你喜欢
      • 2012-12-23
      • 1970-01-01
      • 1970-01-01
      • 2018-03-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-04
      相关资源
      最近更新 更多