码迷,mamicode.com
首页 > Windows程序 > 详细

PopupWindow-----点击弹出 PopupWindow 初始化菜单

时间:2014-11-29 01:25:56      阅读:391      评论:0      收藏:0      [点我收藏+]

标签:style   blog   ar   color   sp   文件   on   div   log   

    /**
     * 点击弹出 PopupWindow  初始化菜单   
     */
    private void initPopupWindow() {
        PopupWindowAdapter adapter = new PopupWindowAdapter();
        mPopDisplay.setAdapter(adapter);     //mPopDisplay 是mPopView 中的listview
        if (mPopupWindow == null) {
            // mPopView   view对象xml文件
             mPopupWindow = new PopupWindow(mPopView, mTopLayout.getWidth(),  //mTopLayout控件的宽   ,mPopView是一个xml
                    LayoutParams.WRAP_CONTENT, true);
            mPopupWindow.setBackgroundDrawable(new BitmapDrawable());
        }
        if (mPopupWindow.isShowing()) {   //开的时候 , 就关闭
            mPopupWindow.dismiss();
        } else {
            mPopupWindow.showAsDropDown(mTopLayout, 0, -10);     //    设置  ,mTopLayout的下面
        }
    }

 

PopupWindow-----点击弹出 PopupWindow 初始化菜单

标签:style   blog   ar   color   sp   文件   on   div   log   

原文地址:http://www.cnblogs.com/java-g/p/4129689.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!