java - 滚动时如何在工具栏下方固定线性布局
解决方案
检查一下,我已经在代码中为您的项目添加了注释
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.design.widget.CollapsingToolbarLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<!-- YOUR ITEMS BETWEEN TABBAR AND APPBAR-->
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<LinearLayout
app:layout_behavior="@string/appbar_scrolling_view_behavior"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:descendantFocusability="blocksDescendants"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<!-- YOUR CUSTOM TABBAR-->
</LinearLayout>
<android.support.v4.widget.NestedScrollView
android:fillViewport="true"
android:layout_width="match_parent"
android:layout_height="match_parent">
<!-- YOU MAIN CONTENT-->
</android.support.v4.widget.NestedScrollView>
</LinearLayout>
</LinearLayout>
</android.support.design.widget.CoordinatorLayout>
</RelativeLayout>
推荐阅读
- java - Volley 在棒棒糖设备中收到 400 错误请求,但与邮递员合作
- r - 将页面添加到单页主题
- r - 强制转换为 R 中的 data.frame 时,来自日期序列 POSIXct 的时区丢失
- php - Laravel:如何创建一个新行并将其附加到我的模型
- php - PHP:加入两个数组
- bdd - 引诱报告中的场景
- javascript - 如何使用 jquery 设置重置选项
- sql-server - 如果变量具有任何值,则 SQL Server 中 where 子句中的 case 语句,否则比较当前
- android - Kotlin 中的 STRING_TOO_LARGE 字符串
- swift - 致命错误:意外发现 nil - 创建 UIImage 时