zoukankan      html  css  js  c++  java
  • PopupWindow 用法小结

    LayoutInflater mLayoutInflater = (LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE);
            view = mLayoutInflater.inflate(resId, null);
    
                  //初始化PopupWindow
            mPopupWindow = new PopupWindow(view, 400, LayoutParams.WRAP_CONTENT);
            // mPopupWindow.setBackgroundDrawable(new
            // BitmapDrawable());//必须设置background才能消失
            mPopupWindow.setBackgroundDrawable(getResources().getDrawable(R.drawable.bg_frame));
    //        mPopupWindow.setOutsideTouchable(true);
    
            // 自定义动画
            // mPopupWindow.setAnimationStyle(R.style.PopupAnimation);
            // 使用系统动画
            mPopupWindow.setAnimationStyle(android.R.style.Animation_Dialog);
            mPopupWindow.update();
            mPopupWindow.setTouchable(true);
            mPopupWindow.setFocusable(true);
            
            if (!mPopupWindow.isShowing())
            {
                // mPopupWindow.showAsDropDown(view,0,0);
    //            mPopupWindow.showAtLocation(view, Gravity.CENTER, 0, 0);
                mPopupWindow.showAsDropDown(view);
            }//显示 popupwindow
  • 相关阅读:
    node mysql
    css问题
    mac 命令
    js 严格模式
    js 数组
    sass
    js 面向对象 定义对象
    response.getWriter().write("中文");乱码问题
    读取文件并找出年龄最大的N个人-兰亭集市笔试题
    阿里巴巴暑期实习生笔试
  • 原文地址:https://www.cnblogs.com/lipeil/p/2651556.html
Copyright © 2011-2022 走看看