Android BottomSheetDialog-如何显示所有内容

Android BottomSheetDialog-如何显示所有内容,android,android-support-library,bottom-sheet,Android,Android Support Library,Bottom Sheet,我正在使用显示选项列表。我遇到的问题是,一些项目最初是隐藏的(用户必须向上滑动才能显示所有内容)。如何强制显示所有内容 我扩展并使用“setContent”设置底部工作表对话框的布局: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.an

我正在使用显示选项列表。我遇到的问题是,一些项目最初是隐藏的(用户必须向上滑动才能显示所有内容)。如何强制显示所有内容

我扩展并使用“setContent”设置底部工作表对话框的布局:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <TextView
        android:id="@+id/dialog_title"
        android:layout_width="match_parent"
        android:layout_height="40dp"
        android:layout_marginEnd="8dp"
        android:layout_marginStart="16dp"
        android:layout_marginTop="8dp"
        android:textSize="@dimen/dialog_title_text_size"
        android:gravity="center_vertical"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        tools:text="Title"
        tools:textColor="@color/blue" />

    <ListView
        android:id="@+id/attachment_picker"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:divider="@null"
        tools:listitem="@layout/item_attachment_picker" />
</LinearLayout>


代码在哪里?@Heisen Berg抱歉,在我输入代码之前意外提交了问题。基本上,我扩展了BottomSheetDialog,并用我上面发布的布局设置了内容视图。检查这个答案,它有点粗糙,但可以正常工作:找到答案了吗?@MortezaRastgoo在评论中说,我最终使用了:不幸的是,它不再开发,所以我认为最好的选择是实现您自己的对话框片段。