繁体   English   中英

当表情符号键盘显示时,调整键盘大小或隐藏虚拟键盘

[英]Resize the keyboard or hide the virtual keyboard when the emoji keyboard shows

我正在使用SuperNova-Emoji库。 我尝试了许多解决方案来调整表情符号键盘的大小或在显示表情符号键盘时隐藏虚拟键盘,但是没有任何效果。

键盘表情符号

这是GitHub中的库链接:
https://github.com/hani-momanii/SuperNova-Emoji

更新1:

这是我的代码; 现在问题是一个无穷循环; 键盘始终显示和隐藏,无休止

SendMessageBox = (EmojiconEditText)findViewById(R.id.txtSendMsg);
    emojiIcon = (ImageView)findViewById(R.id.btn_icon);
    SendMessageButton = (Button)findViewById(R.id.btnSendMsg);
    rootView = (RelativeLayout)findViewById(R.id.layoutbackgrounde);
    EmojIconActions emojiAction = new EmojIconActions(getApplicationContext(),rootView,emojiIcon,SendMessageBox);
    emojiAction.ShowEmojicon();

    emojiAction.setKeyboardListener(new EmojIconActions.KeyboardListener() {
        @Override
        public void onKeyboardOpen() {
            Log.e("Keyboard","open");
            InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
            imm.hideSoftInputFromWindow(rootView.getWindowToken(), 0);
        }

        @Override
        public void onKeyboardClose() {
            Log.e("Keyboard","close");
            //maybe re-appear the input keyboard if you have to on emojikeyboardclose
            //InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
            //imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
        }
    });

您可以在emojikeyboardboardopen上隐藏原始键盘:

emojIcon.setKeyboardListener(new EmojIconActions.KeyboardListener() {
    @Override
    public void onKeyboardOpen() {
        Log.e("Keyboard","open");
        InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
        imm.hideSoftInputFromWindow(view.getWindowToken(), 0);
    }

    @Override
    public void onKeyboardClose() {
        Log.e("Keyboard","close");
        //maybe re-appear the input keyboard if you have to on emojikeyboardclose
        //InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
        //imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
    }
});

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM