popupwindow 显示在屏幕中央的办法

时间:2014-03-26 09:21:24   收藏:0   阅读:734
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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);
}

  

popupwindow 显示在屏幕中央的办法,布布扣,bubuko.com

原文:http://www.cnblogs.com/Cjch/p/3622514.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!