Android 在对话框片段或来自FragmentActivity的弹出窗口上显示片段
我有我的表情图标的代码,如果用户点击表情图标,我想显示这些代码。我不能在键盘之间切换,所以我也可以这样做 //R.layout.popup\u项目Android 在对话框片段或来自FragmentActivity的弹出窗口上显示片段,android,android-layout,android-fragments,android-dialogfragment,android-popupwindow,Android,Android Layout,Android Fragments,Android Dialogfragment,Android Popupwindow,我有我的表情图标的代码,如果用户点击表情图标,我想显示这些代码。我不能在键盘之间切换,所以我也可以这样做 //R.layout.popup\u项目 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:em
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:emojicon="http://schemas.android.com/apk/res-auto"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
tools:context="com.rockerhieu.emojicon.example.MainActivity$PlaceholderFragment" >
<com.rockerhieu.emojicon.EmojiconTextView
android:id="@+id/txtEmojicon"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<com.rockerhieu.emojicon.EmojiconEditText
android:id="@+id/editEmojicon"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
emojicon:emojiconSize="28sp" />
<fragment
android:id="@+id/emojicons"
android:layout_width="fill_parent"
android:layout_height="220dp"
class="com.rockerhieu.emojicon.EmojiconsFragment" />
您可以使用我的图书馆:
这显示了一个弹出窗口,在软键盘上有表情符号
View popUp = getLayoutInflater().inflate(R.layout.popup_item, null);
window = new PopupWindow(getApplicationContext());
window = new PopupWindow(popUp,LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT,true);
window.setAnimationStyle(android.R.style.Animation_Activity);
window.showAtLocation(popUp, Gravity.BOTTOM, 0, 0);
window.setFocusable(true);
window.setOutsideTouchable(true);