android -custom对话框,关闭按钮一半外面

djh*_*s16 2 android dialog popup android-dialogfragment

我想创建如屏幕中所示的DialogFragment,问题是在对话框外创建关闭按钮.

弹出窗口外的关闭按钮溢出

小智 5

使用此代码进行自定义对话框.

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
 android:layout_width="match_parent"
 android:layout_height="match_parent"
 android:background="@android:color/transparent"
 android:orientation="vertical" >

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_margin="25dp"
    android:background="#111111" >
</LinearLayout>

<ImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentRight="true"
    android:layout_alignParentTop="true"
    android:src="@drawable/ic_home" />

</RelativeLayout>
Run Code Online (Sandbox Code Playgroud)