【发布时间】:2016-10-20 15:00:13
【问题描述】:
我在让底页正常工作时遇到问题
在底部工作表中,我在 RecyclerView(在本例中为 TextView)上方有一个项目 - 我希望滚动这两个项目,因此它们都包含在 NestedScrollView 中。
问题是,当屏幕加载时,TextView 被隐藏,我必须向下滚动 RecyclerView 以显示它,然后才能再次向上滚动整个视图以使底部工作表覆盖屏幕的其余部分。
我怎样才能使 TextView 已经在视图中?
```
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:behavior_hideable="false"
app:behavior_peekHeight="auto"
app:layout_behavior="@string/bottom_sheet_behavior">
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="100dp"
android:background="@color/colorPrimaryDark"
android:gravity="center"
android:text="GYUHGHJG"/>
<android.support.v7.widget.RecyclerView
android:id="@+id/recyclerview"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</FrameLayout>
【问题讨论】:
标签: android material-design bottom-sheet