[英]Add a submenu in an Android Keyboard?
只是对于将来可能需要这个的人,主要的方法是使用 xml 键盘:
<?xml version="1.0" encoding="utf-8"?>
<Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
android:keyWidth="10%p"
android:horizontalGap="4px"
android:verticalGap="4px"
android:keyHeight="45dp">
<Row>
<Key android:keyLabel="q" android:popupKeyboard="@xml/qwerty_q" android:keyEdgeFlags="left"/>
<Key android:keyLabel="w" android:popupKeyboard="@xml/qwerty_w"/>
<Key android:keyLabel="e" android:popupKeyboard="@xml/qwerty_e"/>
<Key android:keyLabel="r" android:popupKeyboard="@xml/qwerty_r"/>
<Key android:keyLabel="t" android:popupKeyboard="@xml/qwerty_t"/>
<Key android:keyLabel="y" android:popupKeyboard="@xml/qwerty_y"/>
<Key android:keyLabel="u" android:popupKeyboard="@xml/qwerty_u"/>
<Key android:keyLabel="i" android:popupKeyboard="@xml/qwerty_i"/>
<Key android:keyLabel="o" android:popupKeyboard="@xml/qwerty_o"/>
<Key android:keyLabel="p" android:popupKeyboard="@xml/qwerty_p"/>
</Row>
</Keyboard>
然后在“xml”文件夹下创建每个相关的键盘,格式为 xml:
在弹出式键盘中进行格式化:
<?xml version="1.0" encoding="utf-8"?>
<Keyboard
xmlns:android="http://schemas.android.com/apk/res/android"
android:keyWidth="10%p"
android:horizontalGap="4px"
android:verticalGap="4px"
android:keyHeight="40dp">
<Row android:gravity="center_horizontal">
<Key android:keyLabel="s" android:keyEdgeFlags="left"/>
<Key android:keyLabel="ſ"/>
<Key android:keyLabel="ƨ"/>
<Key android:keyLabel="ß"/>
<Key android:keyLabel="σ"/>
<Key android:keyLabel="ς"/>
</Row>
</Keyboard>
还有一个选项可以添加弹出字符,但我不确定它是否支持输入完整的字符串,如果需要输入“.com”、“.net”、&c,您可能想要这样。
<?xml version="1.0" encoding="utf-8"?>
<Keyboard
xmlns:android="http://schemas.android.com/apk/res/android"
android:keyWidth="10%p"
android:horizontalGap="4px"
android:verticalGap="4px"
android:keyHeight="40dp">
<Row android:gravity="center_horizontal">
<Key android:keyLabel=".com" android:keyOutputText=".com">
<Key android:keyLabel=".net" android:keyOutputText=".net">
<Key android:keyLabel=".jpg" android:keyOutputText=".jpg">
<Key android:keyLabel="·e·" android:keyOutputText="·e·"/>
</Row>
</Keyboard>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.