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);//定位