java - 如何在 android 的 KeyBoardView 中设置行的重力?
问题描述
我正在使用 android KeyboardView
[android.inputmethodservice.KeyboardView] 制作自定义键盘。一切正常,除非我试图减小键的宽度。
问题是:在这里我无法使底行重力居中
这背后的代码是:
<?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="60dp">
<Row android:rowEdgeFlags="bottom">
<Key android:keyLabel="," android:keyWidth="5%p" android:codes="44"/>
<Key android:keyLabel="/" android:keyWidth="5%p" android:codes="47"/>
<Key android:keyLabel="SPACE" android:keyWidth="40%p" android:isRepeatable="true" android:codes="32"/>
<Key android:keyLabel="DEL" android:keyWidth="10%p" android:isRepeatable="true" android:codes="-5"/>
<Key android:keyLabel="DONE" android:keyWidth="10%p" android:codes="-4"/>
</Row>
</Keyboard>
那么,有什么办法可以使这一行的重心居中?
解决方案
推荐阅读
- python - 无法在类中调用函数?
- java - 为什么对自动装配字段所做的更改会影响另一个类中的另一个自动装配字段?
- android - Android Instrumented 测试配置问题
- pytorch - U-Net架构中,h和w不匹配,不知道是不是我理解错了
- javascript - React - 将对象转换为字符串以在 DevExpress React Grid 中显示
- office365 - 希望保护 Outlook 数据文件免遭盗窃
- algorithm - 为什么以下算法(循环排序?!)的时间复杂度是 O(n)?
- gulp - gulp-inject 什么都不注入
- javascript - 如何将暗网标签文件转换为常规 x、y、w、h?
- safari - 适用于所有浏览器的内联录音机