Invalid DialogFragment view on physical device

I have a problem presenting a fragment of a dialog, the emulator looks good, but it looks bad on a physical device and I don't understand what it should be.

Dialog box error

DialogFragment Error

Expected dialogue

DialogFragment Expected

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/background_app"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    tools:context="dialog_test_Fragment">

    <ImageView
        android:id="@+id/imageViewClose"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="right|top"
        android:clickable="true"
        android:src="@drawable/ic_action_close" />

</RelativeLayout>

      

+3


source to share


1 answer


It should be a title DialogFragment


Try to delete it,



@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setStyle(STYLE_NO_TITLE, 0);
}

      

+2


source







All Articles