自定义对话框全屏? [英] Custom Dialog in full screen?

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

问题描述

有什么办法让我的对话框全屏查看,即对话框占据整个屏幕(如一个Activity)。我尝试使用的LayoutParams和样式像 <项目名称=机器人:windowFullscreen>真< /项目> ,但似乎没有奏效。

我发现摆脱了标题栏的一种方式,但不能找到一种方法,把对话框中全屏显示。因此,可以任何一个建议我的方式来做到这一点。

 < XML版本=1.0编码=UTF-8&GT?;
<资源>
<样式名称=MyTheme的父=@安卓风格/ Theme.Dialog>
    <项目名称=机器人:windowFullscreen>真< /项目>
    <项目名称=机器人:窗框> @空< /项目>
    <项目名称=机器人:windowNoTitle>真< /项目>
    <项目名称=机器人:windowIsFloating>真< /项目>
    <项目名称=机器人:windowContentOverlay> @空< /项目>
    <项目名称=机器人:windowBackground> @色/ dialog_background< /项目>
< /风格>
< /资源>
 

解决方案

给它的构造非对话的主题,如 android.R.style.Theme android.R。 style.Theme_Light

Is there any way to make my Dialog view full screen, i.e dialog occupy the entire screen (like an Activity). I tried using the LayoutParams and styles like <item name="android:windowFullscreen">true</item> but nothing seems to be working.

I found a way of getting rid of the Title bar, but couldn't find a way to put a dialog in full screen. So can any one suggest me a way to do it.

<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="MyTheme" parent="@android:style/Theme.Dialog">
    <item name="android:windowFullscreen">true</item>
    <item name="android:windowFrame">@null</item>
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowIsFloating">true</item>
    <item name="android:windowContentOverlay">@null</item>
    <item name="android:windowBackground">@color/dialog_background</item>
</style>
</resources>

解决方案

Give its constructor a non-dialog theme, such as android.R.style.Theme or android.R.style.Theme_Light.

这篇关于自定义对话框全屏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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