PopWindow弹窗简单实现

private void initPopWinDow() {
View view = View.inflate(getActivity(),R.layout.pop,null);
top_recy = view.findViewById(R.id.top_recy);
botton_recy = view.findViewById(R.id.botton_recy);
popupWindow = new PopupWindow(view,1050,300);
popupWindow.setContentView(view);
popupWindow.setOutsideTouchable(true);
popupWindow.setFocusable(true);
popupWindow.setTouchable(true);
ColorDrawable colorDrawable = new ColorDrawable(getResources().getColor(R.color.colorPrimary));
popupWindow.setBackgroundDrawable(colorDrawable);

}

猜你喜欢

转载自blog.csdn.net/black_amber/article/details/90748768