我正在使用 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);
}
});
最佳答案
您可以隐藏 emojikeyboardopen 上的原始键盘:
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);
}
});
关于java - 当表情符号键盘显示时调整键盘大小或隐藏虚拟键盘,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45474586/