Android自定义键盘垂直键和水平键

Android自定义键盘垂直键和水平键,android,android-layout,custom-keyboard,Android,Android Layout,Custom Keyboard,我想创建自定义键盘,其中一些键比正常键盘宽,一些键比正常键盘高。可能吗?这是图片:好的,谢谢你的回答。也许我写的问题有点不清楚,但我想知道如何设计像图片上一样的键盘,而不是如何从一开始就创建键盘。 这有点让人困惑,因为一开始我只使用android:keyHeight atribute,这会导致隐藏其他键。后来我尝试使用android:horizontalGap atribute和height属性,这帮助我获得了想要的结果。 这是我的代码:(需要再调整一些键的大小) 您可以使自定义键盘看起来像您

我想创建自定义键盘,其中一些键比正常键盘宽,一些键比正常键盘高。可能吗?这是图片:

好的,谢谢你的回答。也许我写的问题有点不清楚,但我想知道如何设计像图片上一样的键盘,而不是如何从一开始就创建键盘。 这有点让人困惑,因为一开始我只使用android:keyHeight atribute,这会导致隐藏其他键。后来我尝试使用android:horizontalGap atribute和height属性,这帮助我获得了想要的结果。 这是我的代码:(需要再调整一些键的大小)



您可以使自定义键盘看起来像您想要的任何东西。你们有实际问题吗?并没有,一开始看起来很困惑,但我设法设计了我想要的键盘
<?xml version="1.0" encoding="utf-8"?>
<Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent" android:layout_height="match_parent"
    android:keyWidth="8%p"
    android:keyHeight="14%p">

    <Row>
        <Key android:codes="-3"    android:keyLabel="abc" android:horizontalGap="0.1%p" android:keyHeight="30%"/>
        <Key android:codes="49"    android:keyLabel="1" android:horizontalGap="0.1%p"/>
        <Key android:codes="50"    android:keyLabel="2" android:horizontalGap="0.1%p" />
        <Key android:codes="51"    android:keyLabel="3" android:horizontalGap="0.1%p" />
        <Key android:codes="52"    android:keyLabel="4" android:horizontalGap="0.1%p" />
        <Key android:codes="53"    android:keyLabel="5" android:horizontalGap="0.1%p" />
        <Key android:codes="47"    android:keyLabel="/" android:horizontalGap="0.1%p" android:keyHeight="30%"/>

    </Row>
    <Row>
        <Key android:codes="54"    android:keyLabel="6" android:horizontalGap="8%p"/>
        <Key android:codes="55"    android:keyLabel="7" android:horizontalGap="0.1%p" />
        <Key android:codes="56"    android:keyLabel="8" android:horizontalGap="0.1%p" />
        <Key android:codes="57"    android:keyLabel="9" android:horizontalGap="0.1%p" />
        <Key android:codes="48"    android:keyLabel="0" android:horizontalGap="0.1%p" />
    </Row>
    <Row>
        <Key android:codes="-1" android:keyLabel="Back" android:keyWidth="50%p" android:horizontalGap="0.1%p"/>
        <Key android:codes="-2" android:keyLabel="Next" android:keyWidth="50%p" android:horizontalGap="0.1%p"/>
    </Row>
</Keyboard>