每次我想在对话框片段前显示PopupWindow时,对话框都在弹出窗口前面。我假设对话框在视图树中具有更高的优先级。是否有任何选项可以将我的PopupWindow带到前面,或发送对于back.bringToFront()的对话框,当它在View detailsLayout上被调用时不起作用。
这是一种在Fragment中显示PopupWindow的方法,它在所有屏幕上运行良好:
private void showDetailsTutorial() {
popupWindow = new PopupWindow(getActivity());
LinearLayout viewGroup = (LinearLayout) getActivity().findViewById(R.id.popup_parent);
LayoutInflater layoutInflater =
(LayoutInflater) getActivity().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View detailsLayout = layoutInflater.inflate(R.layout.tutorial_copy_confirmation_layout, viewGroup);
popupWindow.setContentView(layout);
popupWindow.setWidth(1080);
popupWindow.setHeight(1000);
popupWindow.showAtLocation(continueBtn, Gravity.TOP, 0, 250);
AutoResizeTextView skip = (AutoResizeTextView) layout.findViewById(R.id.skip);
skip.setOnClickListener(new View.OnClickListener() {
@Override public void onClick(View view) {
popupWindow.dismiss();
}
});
}