zoukankan      html  css  js  c++  java
  • PopWindow的使用

    方法1:
    public PopupWindow pop=null;
    public View pop_view;
    --------------------
    pop_view = getLayoutInflater().inflate(R.layout.list_pop, null,false);
    pop= new
    PopupWindow(pop_view,LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT,true);
    popupWindow.setBackgroundDrawable(new BitmapDrawable());
    lv_client_droplist = (ListView) popupWindow_view.findViewById(R.id.lv_client_droplist);

    //popupWindow.showAtLocation(findViewById(R.id.parent), Gravity.CENTER| Gravity.CENTER, 0, 0);
    --------------------
    private void dismissPopupWindow() {
            if (popwindow != null && popwindows.isShowing()) {
                 popwindow.dismiss();
                 popwindow = null;
            }
    }    

    @Override
    protected void onDestroy() {
           super.onDestroy();
           dismissPopupWindow();
    }

    ------------------------------------------------------------------------------

    注意:
    pop= new PopupWindow(pop_view,LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT,true);
    可以换为:
    pop= new PopupWindow(pop_view,-2,-2,true);
    popupWindow.dismiss()方法只能关闭显示的窗口并不能释放内存,所以每show一次内存一直在增加。
    -------------------------------------------------------------------------------
    方法2:
        private PopupWindow popwindow;
        private View pop_view;
        ---------------
        pop_view.setFocusable(true);  //锁定后面界面
        popwindow = new PopupWindow(pop_view,-2,-2,true);
        popwindow.setAnimationStyle(R.style.PopupAnimation);
        popwindow.setBackgroundDrawable(new BitmapDrawable());
        popwindow.showAtLocation(findViewById(R.id.parent), Gravity.LEFT| Gravity.TOP, 10, 50);
        popwindow.update();

  • 相关阅读:
    IP寻址方式三
    IP通信基础4
    IP通信基础3
    IP通信基础2
    IP通信基础 1
    IP通信基础
    IP通信原理第二周
    设备选型
    常用virsh命令记录
    [转]enable spice html5 console access in openstack kilo(centos)
  • 原文地址:https://www.cnblogs.com/zhangping/p/3513861.html
Copyright © 2011-2022 走看看