zoukankan      html  css  js  c++  java
  • popupwindow 显示在屏幕中央的办法

    	public static void showShareWindow(Activity activity, View parentView, String pageName){
    		View mContentView = null;
    		V5ShareView mShareView = null;
    		if(mContentView == null){
    			mContentView = LayoutInflater.from(activity).inflate(R.layout.v5_share_layout, null);
    		}
    		
    		if(mPopUpWindow == null){
    			mPopUpWindow = new PopupWindow(mContentView, LayoutParams.MATCH_PARENT,LayoutParams.MATCH_PARENT);
    			mPopUpWindow.setBackgroundDrawable(new BitmapDrawable());
    			mPopUpWindow.setOutsideTouchable(true);
    			mPopUpWindow.setFocusable(true);
    		}
    		
    		if(mShareView == null){
    			mShareView = new V5ShareView(mContentView,pageName,activity);
    		}
    		mShareView.setOnShareViewDismiss(new ShareViewDismiss() {
    			
    			@Override
    			public void dismiss() {
    				mPopUpWindow.dismiss();
    			}
    		});
    		mPopUpWindow.showAtLocation(activity.getWindow().getDecorView(), Gravity.CENTER, 0, 0);
    	}
    

      

  • 相关阅读:
    团队冲刺第八天
    团队冲刺第七天
    团队冲刺第六天
    团队冲刺第五天
    找水王
    团队冲刺第四天
    团队冲刺第三天
    团队冲刺第二天
    团队冲刺第一天
    spring冲刺计划
  • 原文地址:https://www.cnblogs.com/Cjch/p/3622514.html
Copyright © 2011-2022 走看看