Android自定义键盘写入错误的字符

时间:2018-05-25 13:54:12

标签: android xml keyboard

我为三星S8制作了自定义键盘。 keyboard.xml文件如下所示:

<?xml version="1.0" encoding="utf-8"?>
<Keyboard n1:keyWidth="13.999998%p" n1:keyHeight="40.0dip" n1:horizontalGap="2.6000023%p" n1:verticalGap="10.0dip"
  xmlns:n1="http://schemas.android.com/apk/res/android">
    <Row n1:keyHeight="0.100000024px" n1:rowEdgeFlags="top" />
    <Row>
        <Key n1:keyWidth="8.7%p" n1:horizontalGap="1.05%p" n1:codes="49" n1:keyEdgeFlags="left" n1:keyLabel="1" />
        <Key n1:keyWidth="8.7%p" n1:horizontalGap="1.05%p" n1:codes="50" n1:keyLabel="2" />
        <Key n1:keyWidth="8.7%p" n1:horizontalGap="1.05%p" n1:codes="51" n1:keyLabel="3" />
        <Key n1:keyWidth="8.7%p" n1:horizontalGap="1.05%p" n1:codes="52" n1:keyLabel="4" />
        <Key n1:keyWidth="8.7%p" n1:horizontalGap="1.05%p" n1:codes="53" n1:keyLabel="5" />
        <Key n1:keyWidth="8.7%p" n1:horizontalGap="1.05%p" n1:codes="54" n1:keyLabel="6" />
        <Key n1:keyWidth="8.7%p" n1:horizontalGap="1.05%p" n1:codes="55" n1:keyLabel="7" />
        <Key n1:keyWidth="8.7%p" n1:horizontalGap="1.05%p" n1:codes="56" n1:keyLabel="8" />
        <Key n1:keyWidth="8.7%p" n1:horizontalGap="1.05%p" n1:codes="57" n1:keyLabel="9" />
        <Key n1:keyWidth="8.7%p" n1:horizontalGap="1.05%p" n1:codes="48" n1:keyLabel="0" />
    </Row>
</Keyboard>

(我省略了其他行,只有第一行包含在代码中)。

当我点击键盘数字时,而不是写#34; 1&#34;,&#34; 2&#34;等等,我得到ASCII带圆圈的数字,例如&#34;❶& #34;,&#34;❷&#34;等等。 怎么会发生这种情况? ASCII码是正确的(48,49等)。

如何解决此问题?

0 个答案:

没有答案