0

我在 /res/xml 的 xml 文件中有一个键盘定义,如下所示:

<Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
          android:keyWidth="10%p"
          android:horizontalGap="0px"
          android:verticalGap="0px"
          android:keyHeight="@dimen/key_height"
        >
    <Row>
        <Key... />
    </Row>
     <Row>
        <Key... />
    </Row>   

    <Row android:rowEdgeFlags="bottom" >
        <Key ... />

    </Row>
</Keyboard>

我正在寻找一种使一排钥匙比其他钥匙高的方法,但我不知道怎么做。增加键盘标签上的 keyHeight 会使所有键都变大 - 有没有办法只针对一行?

4

2 回答 2

2

我认为您可以使用此defaultHeight定义连续键的默认高度..

于 2012-04-02T06:16:15.483 回答
1

您可以将android:keyHeight属性直接放在<Row>元素上,在这种情况下,它将覆盖<Keyboard>. 这就是我为我的项目 DotDash 键盘所做的(其中一排键是 20% 的屏幕高度,另一排是 17%)。

也可以看看:

<Row>元素的文档:http: //developer.android.com/reference/android/inputmethodservice/Keyboard.Row.html

具有两个不同大小行的键盘布局示例:http ://code.google.com/p/dotdash-keyboard-android/source/browse/res/xml/dotdash.xml

于 2012-04-06T22:21:07.683 回答