【发布时间】:2021-11-03 06:02:53
【问题描述】:
我已经反驳了需要实现可滚动模态底页的情况。基本上,它首先会显示一半的屏幕,然后向上滚动时,它会拉伸到屏幕的 90%。如果继续向上滑动,它将滚动底部表格内的内容。
我的尝试
layout.xml
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/design_bottom_sheet"
style="@style/RootLayout"
android:background="@drawable/rounded_shape"
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<...Content.../>
</android.core.widget.NestedScrollView>
</FrameLayout>
<androidx.coordinatorlayout.widget.CoordinatorLayout
底页对话框类
我在accepted answer这里关注了答案
结果
打开时它只显示一半的屏幕,当我像这样result 向上滚动内容时,不会将底部的工作表滚动到展开状态。
期待
我希望上面的代码应该像这样expectation
有没有人有解决这种情况的方法? 谢谢
【问题讨论】:
标签: android bottom-sheet