1

我有一个带有数字和字母的自定义键盘。我需要在键盘上显示符号。

键盘.xml 作为

<?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">
   <Row>
    <Key android:codes="8" android:keyLabel="1" android:keyEdgeFlags="left"/>
        <Key android:codes="9" android:keyLabel="2"/>
        <Key android:codes="10" android:keyLabel="3"/>
        <Key android:codes="11" android:keyLabel="4"/>
        <Key android:codes="12" android:keyLabel="5"/>
        <Key android:codes="13" android:keyLabel="6"/>
        <Key android:codes="14" android:keyLabel="7"/>
        <Key android:codes="15" android:keyLabel="8"/>
        <Key android:codes="16" android:keyLabel="9"/>
        <Key android:codes="7" android:keyLabel="0" android:keyEdgeFlags="right"/>
   </Row>
    <Row>
        <Key android:codes="45" android:keyLabel="q" android:keyEdgeFlags="left"/>
        <Key android:codes="51" android:keyLabel="w"/>
        <Key android:codes="33" android:keyLabel="e"/>
        <Key android:codes="46" android:keyLabel="r"/>
        <Key android:codes="48" android:keyLabel="t"/>
        <Key android:codes="53" android:keyLabel="y"/>
        <Key android:codes="49" android:keyLabel="u"/>
        <Key android:codes="37" android:keyLabel="i"/>
        <Key android:codes="43" android:keyLabel="o"/>
        <Key android:codes="44" android:keyLabel="p" android:keyEdgeFlags="right"/>
    </Row>

    <Row>
        <Key android:codes="29" android:keyLabel="a" android:horizontalGap="5%p"
                android:keyEdgeFlags="left"/>
        <Key android:codes="47" android:keyLabel="s"/>
        <Key android:codes="32" android:keyLabel="d"/>
        <Key android:codes="34" android:keyLabel="f"/>
        <Key android:codes="35" android:keyLabel="g"/>
        <Key android:codes="36" android:keyLabel="h"/>
        <Key android:codes="38" android:keyLabel="j"/>
        <Key android:codes="39" android:keyLabel="k"/>
        <Key android:codes="40" android:keyLabel="l" android:keyEdgeFlags="right"/>
    </Row>

    <Row>
        <Key android:codes="54" android:keyLabel="z" android:horizontalGap="5%p"
                android:keyEdgeFlags="left"/>
        <Key android:codes="52" android:keyLabel="x"/>
        <Key android:codes="31" android:keyLabel="c"/>
        <Key android:codes="50" android:keyLabel="v"/>
        <Key android:codes="30" android:keyLabel="b"/>
        <Key android:codes="42" android:keyLabel="n"/>
        <Key android:codes="41" android:keyLabel="m"/>
         <Key android:codes="-3" android:keyLabel="Done"/>
        <Key android:codes="67" android:keyLabel="Delete"
                android:keyWidth="15%p" android:keyEdgeFlags="right"
                android:isRepeatable="true"/>
    </Row>

    <Row android:rowEdgeFlags="bottom">
        <Key android:codes="-3" android:keyLabel="\@" android:horizontalGap="20%p"
                android:keyWidth="15%p" android:keyEdgeFlags="left"/>
        <Key android:codes="-2" android:keyLabel=".com" android:keyWidth="15%p"/>
        <Key android:codes="-1" android:keyLabel="-"
                android:keyWidth="15%p" />
        <Key android:codes="-4" android:keyLabel="."
                android:keyWidth="15%p" android:keyEdgeFlags="right"/>
    </Row>
</Keyboard>

我想显示符号和下一个选项来移动 listview 中存在的另一个编辑 text.edit 文本。Listview 包含 textview 和编辑 text。帮我解决这个问题。

4

1 回答 1

2

要显示符号,您必须创建另一个 xml 并在单击任何按钮时切换(更改键盘设计)

符号.xml

<?xml version="1.0" encoding="utf-8"?>
<Keyboard android:keyWidth="10.000002%p" android:keyHeight="@dimen/key_height" android:horizontalGap="0.0px" android:verticalGap="4.0px"
  xmlns:android="http://schemas.android.com/apk/res/android">
    <Row>
        <Key android:codes="49" android:keyEdgeFlags="left" android:keyLabel="1" />
        <Key android:codes="50" android:keyLabel="2" />
        <Key android:codes="51" android:keyLabel="3" />
        <Key android:codes="52" android:keyLabel="4" />
        <Key android:codes="53" android:keyLabel="5" />
        <Key android:codes="54" android:keyLabel="6" />
        <Key android:codes="55" android:keyLabel="7" />
        <Key android:codes="56" android:keyLabel="8" />
        <Key android:codes="57" android:keyLabel="9" />
        <Key android:codes="48" android:keyEdgeFlags="right" android:keyLabel="0" />
    </Row>
    <Row>
        <Key android:codes="64" android:keyEdgeFlags="left" android:keyLabel="\@" />
        <Key android:codes="35" android:keyLabel="\#" />
        <Key android:codes="36" android:keyLabel="$" />
        <Key android:codes="37" android:keyLabel="%" />
        <Key android:codes="38" android:keyLabel="&amp;" />
        <Key android:codes="42" android:keyLabel="*" />
        <Key android:codes="45" android:keyLabel="-" />
        <Key android:codes="61" android:keyLabel="=" />
        <Key android:codes="40" android:keyLabel="(" />
        <Key android:codes="41" android:keyEdgeFlags="right" android:keyLabel=")" />
    </Row>
    <Row>
        <Key android:keyWidth="14.999998%p" android:codes="-1" android:keyEdgeFlags="left" android:isModifier="true" android:isSticky="true" android:keyIcon="@drawable/sym_keyboard_shift" />
        <Key android:codes="33" android:keyLabel="!" />
        <Key android:codes="34" android:keyLabel="&quot;" />
        <Key android:codes="39" android:keyLabel="'" />
        <Key android:codes="58" android:keyLabel=":" />
        <Key android:codes="59" android:keyLabel=";" />
        <Key android:codes="47" android:keyLabel="/" />
        <Key android:codes="63" android:keyLabel="\?" />
        <Key android:keyWidth="14.999998%p" android:codes="-5" android:keyEdgeFlags="right" android:isRepeatable="true" android:keyIcon="@drawable/sym_keyboard_delete" />
    </Row>
    <Row android:rowEdgeFlags="bottom">
        <Key android:keyWidth="14.999998%p" android:codes="-11" android:keyLabel="ABC" />
        <Key android:keyWidth="13.999998%p" android:codes="-10" android:keyIcon="@drawable/e405" />
        <Key android:keyWidth="35.99999%p" android:codes="32" android:isRepeatable="true" android:keyIcon="@drawable/sym_keyboard_space" />
        <Key android:keyWidth="14.999998%p" android:codes="44" android:keyLabel="," />
        <Key android:keyWidth="20.000004%p" android:codes="10" android:keyEdgeFlags="right" android:keyIcon="@drawable/sym_keyboard_return" />
    </Row>
</Keyboard>
于 2015-03-06T07:28:10.907 回答