android - 自定义键盘 - 错误的数字输入
问题描述
我为我的三星 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>
(我省略了其他行,只有第一行包含在代码中)。
当我点击键盘数字时,我得到的不是写“1”、“2”等,而是用 ASCII 圈起来的数字,例如“❶”、“❷”等。怎么会这样?ASCII 代码是正确的(48、49 等)。
当然,这个错误只发生在自定义键盘上,而不是三星 S8 默认键盘。
我该如何解决这个问题?
解决方案
推荐阅读
- ruby-on-rails - “如何修复安装包时我在 Gemfile pg 中收到错误”
- kubernetes - 变异准入控制器不会在部署创建/更新时被调用
- r - 如何通过调用字符值来命名值?
- apache-camel - 如何处理骆驼快速修复无法发送异常?
- ansible - 在 Ansible 中注册和使用多个变量
- php - 使用模数/循环并放置在每 5 个位置
- c# - 找不到 api/values 404 localhost - ASP.NET Core
- java - 如何使用 tomcat API 重新连接到 websocket URI
- node.js - 当我们使用 ReactJS 和 NodeJS 时,拥有两个运行端口的目的是什么?
- javascript - 谷歌云功能不执行条纹调用