Android弹出窗口全屏 [英] Android Popup Window Full Screen

查看:973
本文介绍了Android弹出窗口全屏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为全屏创建弹出窗口

I want to create a popupwindow for fullscreen

我使用了以下内容:

LayoutInflater inflater = (LayoutInflater) MainActivity.this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);

layoutt = inflater.inflate(R.layout.loginto,(ViewGroup) findViewById(R.id.window1));

pwindow = new PopupWindow(layoutt,LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT,true);

这涵盖了操作栏,但没有覆盖全屏.

This covers the action bar but not the full screen..

api 11+还支持LayuotParams.WRAP_CONTENT.我需要从api级别8开始工作的解决方案.

Also LayuotParams.WRAP_CONTENT is supported by api 11+ . i need the solution to work from api level 8.

推荐答案

对于全屏显示,您必须传递MATCH_PARENT参数而不是WRAP_CONTENT

For the full screen you have to pass the MATCH_PARENT params instead of WRAP_CONTENT

pwindow = new PopupWindow(layout,LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT,true);

这篇关于Android弹出窗口全屏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆