qq_35341764 2016-12-29 08:41 采纳率: 0%
浏览 814

xml文件根布局是相对布局时,点击外部不会消失,改为线性布局则正常,为什么?(在webview中)

private void showPopWindow() {
View v = LayoutInflater.from(this).inflate(R.layout.popupwindow,null);
mPopupWindow = new PopupWindow(v, ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT,true);
mPopupWindow.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);

    ColorDrawable cd = new ColorDrawable(0x000000);
    mPopupWindow.setBackgroundDrawable(cd);

    mPopupWindow.setFocusable(true);
    mPopupWindow.setTouchable(true);
    mPopupWindow.setOutsideTouchable(true);
    mPopupWindow.setAnimationStyle(R.style.popupAnimation);

    mPopupWindow.showAtLocation(mRootView, Gravity.BOTTOM,0,0);
    mPopupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {

        @Override
        public void onDismiss() {
            hidePrompt();
        }
    });
    setListener(v);
}
  • 写回答

0条回答

    报告相同问题?

    悬赏问题

    • ¥15 vhdl+MODELSIM
    • ¥20 simulink中怎么使用solve函数?
    • ¥30 dspbuilder中使用signalcompiler时报错Error during compilation: Fitter failed,求解决办法
    • ¥15 gwas 分析-数据质控之过滤稀有突变中出现的问题
    • ¥15 没有注册类 (异常来自 HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
    • ¥15 知识蒸馏实战博客问题
    • ¥15 用PLC设计纸袋糊底机送料系统
    • ¥15 simulink仿真中dtc控制永磁同步电机如何控制开关频率
    • ¥15 用C语言输入方程怎么
    • ¥15 网站显示不安全连接问题