PopupWindow
PopupWindow也是一个对话框,它与Dialog相似,不同的是它可以设置弹出的对话框的位置、大小,也可以通过它弹出动画等。
//创建PopupWindow对象
popup=new PopupWindow(MainActivity.this);
//获得布局的view
View popview=getLayoutInflater().inflate(R.layout.popup_layput, null);
//设置对话框的宽度、高度 popup.setWidth(ViewGroup.LayoutParams.MATCH_PARENT);
popup.setHeight(ViewGroup.LayoutParams