对话在Android奇巧像是被剪掉奇巧、剪掉、Android

2023-09-12 11:22:42 作者:我开始嘲笑你所谓的高傲

我用对话框主题的活动,并能正常工作在Android< = 4.3,但不是最新的奇巧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.

推荐答案

可以解决这个问题要从以下code切断。

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

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