工作,我在标签布局使用NestedScrollView,当我在NestedScrollView实施RecyclerView会出现两个问题:RecyclerView不NestedScrollView
- 工具栏没有隐瞒。
- RecyclerView不能平滑滚动。
这里是我的代码:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:fillViewport="true"
xmlns:android="http://schemas.android.com/apk/res/android">
<RelativeLayout
android:layout_width="match_parent"
android:background="#fff"
android:layout_height="wrap_content">
<android.support.v7.widget.RecyclerView
android:layout_below="@+id/toolbar"
android:id="@+id/recyclerView"
android:background="#fafafa"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
<ProgressBar
android:id="@+id/progressBar1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
</RelativeLayout>
</android.support.v4.widget.NestedScrollView>
你有NestedScrollView中的工具栏,因为根据你的代码,你用android添加你的RecyclerView:layout_below =“@ + id/toolbar” –