В моем фрагменте есть PopupWindow.Android SoftKeyboard нажимает макет вверх, но после того, как он скрыт, он не тянет макет назад. Как это решить?
PopupWindow показывает полноэкранный режим.
Внутри PopupWindow есть EditText.
Когда я нажимаю в EditText, SoftKeyboard показывает и нажимает мой PopupWindow вверх.
Когда я скрываю SoftKeyboard, мой PopupWindow не сбрасывается. Зачем? Как решить это
Я пытаюсь установить android:windowSoftInputMode="adjustPan"
и android:windowSoftInputMode="adjustResize"
, но это не работает (мой PopupWindow не тянет вниз)
EDIT
1.Это EditText в моем всплывающем макете
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:layout_marginTop="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/edt_popname"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minHeight="68dp"
android:minWidth="300dp"
android:gravity="center_horizontal|center_vertical"
android:textSize="30dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:imeOptions="actionNext"/>
</RelativeLayout>
<RelativeLayout
android:layout_marginTop="20dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/edt_popprice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minHeight="68dp"
android:minWidth="300dp"
android:gravity="center_horizontal|center_vertical"
android:textSize="30dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:imeOptions="actionNext"/>
</RelativeLayout>
</LinearLayout>
2.Это код mypopup
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
if (rootView == null) {
rootView = inflater.inflate(R.layout.fragment_order, container, false);
final View actionview = inflater.inflate(R.layout.order_popup, (ViewGroup)(getActivity().findViewById(R.id.rl_orderpopup)));
this.popupWindow = new PopupWindow(actionview, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT, true);
this.popupWindow.setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
this.popupWindow.setOutsideTouchable(false);
this.popupWindow.setAnimationStyle(R.style.Animation);
}
return rootView;
}
3.This код для показа всплывающего окна
private AdapterView.OnItemClickListener ItemGridViewItemClickListener = new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {
ItemInfo info = (ItemInfo) adapterView.getItemAtPosition(position);
Log.i("ItemClick", info.getName());
popupWindow.showAtLocation(rootView, Gravity.CENTER, 0, 0);
}
};
4.This является деятельность в очевидном
<activity
android:name=".MainActivity"
android:clearTaskOnLaunch="true"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan">
</activity>
можете ли вы разместить здесь свой код? – Techfist
@Techfist Пожалуйста, смотрите мой код ниже EDIT – user2955394