Android自定义键盘?

Android自定义键盘?,android,keyboard,android-softkeyboard,Android,Keyboard,Android Softkeyboard,您好,我正在为我的应用程序开发自定义键盘 i、 e ... ... 我想知道是否有任何方法或安卓标签可用于设置不可见或可见键盘键 类似于android:visibility=“gone”或setVisibility(View.gone)的键盘布局 因为在我的应用程序中,键盘有很多变化 任何与此相关的信息。可以通过更改键的宽度来隐藏键 以下是隐藏语言开关键的示例: void setLanguageSwitchKeyVisibility(boolean visible) { if (vi

您好,我正在为我的应用程序开发自定义键盘

i、 e


...
...
我想知道是否有任何方法或安卓标签可用于设置不可见或可见键盘

类似于android:visibility=“gone”或setVisibility(View.gone)的键盘布局

因为在我的应用程序中,键盘有很多变化


任何与此相关的信息。

可以通过更改键的宽度来隐藏键

以下是隐藏语言开关键的示例:

void setLanguageSwitchKeyVisibility(boolean visible) {
    if (visible) {
        // The language switch key should be visible. Restore the size of the mode change key
        // and language switch key using the saved layout.
        mModeChangeKey.width = mSavedModeChangeKey.width;
        mModeChangeKey.x = mSavedModeChangeKey.x;
        mLanguageSwitchKey.width = mSavedLanguageSwitchKey.width;
        mLanguageSwitchKey.icon = mSavedLanguageSwitchKey.icon;
        mLanguageSwitchKey.iconPreview = mSavedLanguageSwitchKey.iconPreview;
    } else {
        // The language switch key should be hidden. Change the width of the mode change key
        // to fill the space of the language key so that the user will not see any strange gap.
        mModeChangeKey.width = mSavedModeChangeKey.width + mSavedLanguageSwitchKey.width;
        mLanguageSwitchKey.width = 0;
        mLanguageSwitchKey.icon = null;
        mLanguageSwitchKey.iconPreview = null;
    }
}

编辑
LatinKeyboard
以隐藏一个键。

ya这是一个很好的链接。我会试试看。谢谢。但我不知道我能不能满足我的要求。但再次感谢你。这样做是绝对可能的。您必须修改要在可见性模式下使用的键的键盘行为。
void setLanguageSwitchKeyVisibility(boolean visible) {
    if (visible) {
        // The language switch key should be visible. Restore the size of the mode change key
        // and language switch key using the saved layout.
        mModeChangeKey.width = mSavedModeChangeKey.width;
        mModeChangeKey.x = mSavedModeChangeKey.x;
        mLanguageSwitchKey.width = mSavedLanguageSwitchKey.width;
        mLanguageSwitchKey.icon = mSavedLanguageSwitchKey.icon;
        mLanguageSwitchKey.iconPreview = mSavedLanguageSwitchKey.iconPreview;
    } else {
        // The language switch key should be hidden. Change the width of the mode change key
        // to fill the space of the language key so that the user will not see any strange gap.
        mModeChangeKey.width = mSavedModeChangeKey.width + mSavedLanguageSwitchKey.width;
        mLanguageSwitchKey.width = 0;
        mLanguageSwitchKey.icon = null;
        mLanguageSwitchKey.iconPreview = null;
    }
}