LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View inflaterView = inflater.inflate(R.layout.fuel_popup, null); PopupWindow popupWindow = new PopupWindow(inflaterView, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, true); popupWindow.setBackgroundDrawable(new ColorDrawable(Color.GRAY)); popupWindow.setOutsideTouchable(true); popupWindow.showAtLocation(composerButtonsShowHideButton, Gravity.CENTER, 0, 0);
1
2
3
4
5
6 |
LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View inflaterView = inflater.inflate(R.layout.fuel_popup, null ); PopupWindow popupWindow = new
PopupWindow(inflaterView, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, true ); popupWindow.setBackgroundDrawable( new
ColorDrawable(Color.GRAY)); popupWindow.setOutsideTouchable( true ); popupWindow.showAtLocation(composerButtonsShowHideButton, Gravity.CENTER, 0 , 0 ); |
LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); View inflaterView = inflater.inflate(R.layout.fuel_popup, null); PopupWindow popupWindow = new PopupWindow(inflaterView, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, true); popupWindow.setBackgroundDrawable(new ColorDrawable(Color.GRAY)); popupWindow.setOutsideTouchable(true); popupWindow.showAtLocation(composerButtonsShowHideButton, Gravity.CENTER, 0, 0);//定位
Android PopupWindow,布布扣,bubuko.com
原文:http://www.cnblogs.com/Launchercher/p/3568939.html