表情符号,我已经开发了一个键盘,现在我需要表情符号吧,其他的问题我已经意识到最好的办法是与popupwindow,实现Android键盘与popupwindow
这里就是我完成:
case -102:
LayoutInflater layoutInflater
= (LayoutInflater)getBaseContext()
.getSystemService(LAYOUT_INFLATER_SERVICE);
View popupView = layoutInflater.inflate(R.layout.emoji_view, null);
final PopupWindow popupWindow = new PopupWindow(
popupView,
LinearLayout.LayoutParams.MATCH_PARENT,
LinearLayout.LayoutParams.MATCH_PARENT);
popupWindow.showAsDropDown(getWindow().getOwnerActivity().getCurrentFocus(),50, -30);
不幸的是,这并不工作,showAsDropDown需要一个视图作为其第一个变种,如果键盘是另一个应用程序,我没有一个视图给他......
有没有办法解决这个问题? 或者我是否全都错了,还有更好的方法...
所有帮助将不胜感激!
试试这个[link](https://github.com/vanniktech/Emoji/blob/master/app/src/main/res/layout/adapter_chat.xml) –
不起作用,它只适用于应用程序,我试图在键盘上实现它,所以我没有rootView – yanivtwin