Android KitKat 上的对话框似乎被切断了 [英] Dialog on Android KitKat seems to be cut

查看:33
本文介绍了Android KitKat 上的对话框似乎被切断了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为 Activity 使用了对话框主题,它在 Android <= 4.3 上运行良好,但在最新的 KitKat 4.4 上不起作用.这是问题的屏幕截图:

I used dialog theme for an Activity and it works fine on Android <= 4.3 but not on the latest KitKat 4.4. Here's a screenshot of the problem:

布局顶部缺失.你可以看到边界似乎被切断了.

Top of the layout is missing. You can see that the bounds seems to be cut.

我正在使用Android模拟器来测试应用程序,所以我不知道问题是由于虚拟机还是由于其他原因.

I'm using an Android emulator to test the app, so I don't know if the problem is due to the virtual machine or due to some other reason.

推荐答案

你可以从下面的代码中解决问题.

You can solve the problem to be cut from below code.

dialog.getWindow().setFlags(
    WindowManager.LayoutParams.FLAG_FULLSCREEN, 
    WindowManager.LayoutParams.FLAG_FULLSCREEN);

这篇关于Android KitKat 上的对话框似乎被切断了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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