我已经实现了一个布局,其中BottomSheetBehaviour
和设置behavior_peekHeight
为300dp和behavior_hideable
为true
。BottomSheetBehaviour启用拖动顶部
代码示例
<FrameLayout
android:id="@+id/sheet_layout"
android:layout_width="match_parent"
android:layout_height="@dimen/map_view_height"
android:background="@color/white"
app:behavior_hideable="true"
app:behavior_peekHeight="300dp"
app:behavior_skipCollapsed="true"
app:layout_behavior="@string/bottom_sheet_behavior">
<include layout="@layout/sheet_content_layout"/>
</FrameLayout>
在这里,我能够与拖到底部隐藏布局。但是,一旦我将布局拖到底部,我就无法将其拖回原始的峰值高度。我怎样才能做到这一点?
我不认为这是不好的要求用户从底部拖动它,尤其是对于那些使用软件底部的人。 – BakaWaii
@BakaWaii我将展示一个最小的部分被拖到顶部。例如,如果您使用新的优步,您将能够从底部拖动消息。 – ImMathan