繁体   English   中英

物理设备上的错误视图DialogFragment

[英]Wrong view DialogFragment on physical device

我有一个问题,对话框片段的视图看起来很好的模拟器,但它在物理设备上看起来很糟糕,我不明白它应该是什么。

DialogFragment错误

DialogFragment错误

DialogFragment预计

DialogFragment预计

<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>

这必须是DialogFragment的标题
试着删除它,

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM