LayoutInflater inflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
View contentView = inflater.inflate(R.layout.popwindow, null);
PopupWindow popupWindow = new PopupWindow(contentView,
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
popupWindow.setBackgroundDrawable(MainActivity.this.getResources()
.getDrawable(R.drawable.ic_launcher));
popupWindow.setFocusable(true);
popupWindow.showAsDropDown(v);
时间: 2024-10-11 08:08:38