PopupWindow
View pop_view = LayoutInflater.from(MoviePlayActivity.this).inflate(R.layout.moviedetail_pop,null);//PopupWindow对象
//获取当前activity的布局
popupWindow=new PopupWindow(MoviePlayActivity.this);//初始化PopupWindow对象
popupWindow.setContentView(pop_view);//设置PopupWindow布局文件
popupWindow.setWidth(ViewGroup.LayoutParams.MATCH_PARENT);//设置PopupWindow宽
popupWindow.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT);//设置PopupWindow高
// 在外边可以点击,并让popWindow消失
popupWindow.setOutsideTouchable(true);
popupWindow.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
popupWindow.showAsDropDown(mVideoView, 0, 0);
popupWindow.setBackgroundDrawable(null);
来源:oschina
链接:https://my.oschina.net/hongjiang/blog/4287757