Android   发布时间:2022-04-28  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了android – BottomSheetDialog没有显示?大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在尝试实现新的BottomSheetDialog,但是当我调用.show()时,它会显示背景阴影,但不显示我的布局.

这是我的代码

<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.nestedScrollView
    xmlns:android="http://scheR_781_11845@as.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:BACkground="@color/white">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingTop="4dp"
            android:paddingBottom="4dp"
            android:paddingStart="8dp"
            android:paddingend="8dp">

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Notes"
                android:layout_alignParentStart="true"
                android:layout_centerVertical="true"
                android:textColor="@android:color/black"/>

            <Switch
                android:id="@+id/notes"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerVertical="true"
                android:layout_alignParentEnd="true"/>

        </RelativeLayout>

    </RelativeLayout>

</android.support.v4.widget.nestedScrollView>

然后:

@H_43_9@mSetTingsDialog = new BottomSheetDialog(this); View v = getLayoutInflater().inflate(R.layout.reader_setTings,null); mSetTingsDialog.setContentView(v); mSetTingsDialog.show();

我该如何解决这个问题?

解决方法

我遇到了这个问题,我的理由是

>对话框XML名称与其他模块XML文件名相同,因此请尝试将其重命名为另一个>检查布局文件,可能有一些错误,保持最简单的布局测试.

大佬总结

以上是大佬教程为你收集整理的android – BottomSheetDialog没有显示?全部内容,希望文章能够帮你解决android – BottomSheetDialog没有显示?所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。