Android:如何使dialogFragment变为全屏 [英] Android: How to have dialogFragment to fullscreen

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

问题描述

您好,我试图将主题覆盖到全屏的dialogFragment上,但是我想要的全屏是上一个活动的覆盖,因此当打开dialogFragment时,我们仍然可以从屏幕之间的填充中看到后退活动和dialogFragment.

Hello I have tried to override the theme to the dialogFragment for fullscreen but the full screen I wanted was an overlay on top of the previous activity so when the dialogFragment is opened, we still can see back activity from the padding between the screen and the dialogFragment.

这是我用于全屏显示的样式

This is the style I have used for full screen

<style name="fullscreen_dialog" parent="android:Theme" >
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowFullscreen">true</item>
    <item name="android:windowIsFloating">false</item>
</style>

推荐答案

您可以像这样在代码中手动设置布局参数.希望能帮助到你 ! :).还可以通过在android中调整自定义对话框的大小来进行检查在Android中调整自定义对话框的大小

You could just manually set the layout params in code like so. Hope it helps ! :). Also check it this SO Adjusting size of custom dialog box in android

Window window = myDialog.getWindow();
window.setLayout(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);

这篇关于Android:如何使dialogFragment变为全屏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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