LayoutInflater mLayoutInflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
View menuView = (View) mLayoutInflater.inflate(R.layout.date_layout,null, true);//PopupWindow的布局
Button dateOk = (Button) menuView.findViewById(R.id.date_ok);//PopupWindow上的控件
//创建一个PopupWindow对象
PopupWindow popupWindow = new PopupWindow(menuView, LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT);
popupWindow.showAtLocation(findViewById(R.id.****), Gravity.BOTTOM, 0, 0);//PopupWindow显示的位置
popupWindow.update();
PopupWindow的使用
最新推荐文章于 2021-11-04 17:33:51 发布