我正在尝试打开一个对话框来覆盖大部分屏幕(我的意思是它仍然具有很好的圆形效果,但覆盖了后面的内容)
我一直在尝试使用填充父项,但它一直表现得像一个包装内容
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:layout_centerHorizontal="true"
>
<LinearLayout
android:gravity="center_horizontal"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<SurfaceView android:id="@+id/surface"
android:layout_width="400px"
android:layout_height="200px"
android:layout_centerHorizontal="true">
</SurfaceView>
<Button android:id="@+id/Button01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="Ok, Let me play !!!" />
</LinearLayout>
</LinearLayout>
我在这里尝试了解决方案
dialog.getWindow().setLayout(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
它做我想要的
所以现在我想知道我的 xml 中的内容(如果我能提供帮助,我会尝试将所有布局行为放在 xml 中而不是我的代码中 ^^)