我已经创建了 BottomSheetDialogFragment
并访问我的 fragment ,但它没有完全打开,它只显示底部的小条,如下所示
我正在使用默认的 BottomSheetDialogFragment
文件,无需更改任何内容。
xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.recyclerview.widget.RecyclerView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:paddingTop="@dimen/list_item_spacing_half"
android:paddingBottom="@dimen/list_item_spacing_half"
tools:context=".ui.SettingFragment"
tools:listitem="@layout/fragment_setting_list_dialog_item" />
显示通话功能
val addBottomDialogFragment: SettingFragment = SettingFragment.newInstance(10)
addBottomDialogFragment.show(supportFragmentManager, "tag")
最佳答案
BottomSheet 的高度取决于子内容的高度因此首先您应该在底部工作 TableView 下添加一些 subview 或内容。如果您使用 RecyclerView,请使用数据设置适配器。
关于android - BottomSheetDialogFragment未打开,仅显示小白条,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63222812/