joh*_*crq 5 android android-recyclerview android-coordinatorlayout
使用coordinatorLayout将滚动行为添加到布局时,如下所示:
<android.support.design.widget.CoordinatorLayout
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:fitsSystemWindows="true">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/AppTheme.PopupOverlay" />
</android.support.design.widget.AppBarLayout>
<FrameLayout
android:id="@+id/mainContent"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
</FrameLayout>
</android.support.design.widget.CoordinatorLayout>
Run Code Online (Sandbox Code Playgroud)
mainContent是重要的部分.
真正的布局将在此容器内膨胀.
想象我View由一个RecyclerView,并在屏幕的底部有固定的布局.
有人知道一种方法来删除底部固定布局的滚动行为并保持RecyclerView- Toolbar隐藏行为吗?
在“CoordinatorLayout”内部,滚动的视图必须首先是不可滚动的视图,并且只能在其后。我设法通过将不可滚动布局放置在“mainContent”之外(就在其下方)来解决该问题
| 归档时间: |
|
| 查看次数: |
1498 次 |
| 最近记录: |