gpt4 book ai didi

android - 物理设备上的错误 View DialogFragment

转载 作者:太空狗 更新时间:2023-10-29 13:08:33 25 4
gpt4 key购买 nike

我有一个对话框 fragment 的 View 在模拟器上看起来不错,但在物理设备上看起来很糟糕,我不明白它应该是什么。

DialogFragment 错误

DialogFragment Error

需要 DialogFragment

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>

最佳答案

那必须是DialogFragment
的标题尝试删除它,

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

关于android - 物理设备上的错误 View DialogFragment,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44193548/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com