http://stackoverflow.com/questions/31722798/enteralwayscollapsed-does-not-bring-back-the-toolbar-when-scrolling-down/31946043#31946043

1.enterAlwaysCollapsed: 当你的视图已经设置minHeight属性又使用此标志时,你的视图只能已最小高度进入,只有当滚动视图到达顶部时才扩大到完整高度

2. 含有app:layout_scrollFlags的view必须声明在不含该属性的view的布局的前面

 

Hard to say without seeing your code, as a guess this could be one of two things:


1.

enterAlwaysCollapsed - This flag defines how View enter back into the screen. When your view has declared a minHeight and you use this flag, your View will only enter at its minimum height (i.e., ‘collapsed’), only re-expanding to its full height when the scrolling view has reached it’s top. Use it with scroll flag like this: scroll|enterAlwaysCollapsed

Anyway it seems like it doesn't work as described in minHeight part.

 


2.

You have not formatted your code correctly.

From Android's Developer Blog I quote on "CoordinatorLayout and the app bar":

One note: all views using the scroll flag must be declared before views that do not use the flag. This ensures that all views exit from the top, leaving the fixed elements behind.

This link also goes into more detail about how to use enterAlwaysCollapsed and is worth looking at.

app:layout_scrollFlags不起作用的更多相关文章

  1. 尴尬的app:layout_scrollFlags="scroll|enterAlways" 配合NavigationDrawer

    昨天想到了NavigationDrawer中Item点击的问题. 点击Drawer中的一个Item需要到一个新的页面,你是应该打开一个新的Activity呢还是直接用fragment呢? 如果打开新的 ...

  2. WinForm 修改App.config不起作用(但是调试没有异常)

    修改Bin下的.exe.config文件,就能达到效果了. appconfig的修改,会保留在项目中,似乎不会实时地更改到.exe.config中..

  3. 带你实现开发者头条APP(四)---首页优化(加入design包)

    title: 带你实现开发者头条APP(四)---首页优化(加入design包) tags: design,Toolbar,TabLayout,RecyclerView grammar_cjkRuby ...

  4. [转]Android App整体架构设计的思考

    1. 架构设计的目的 对程序进行架构设计的原因,归根到底是为了提高生产力.通过设计使程序模块化,做到模块内部的高聚合和模块之间的低耦合.这样做的好处是使得程序在开发的过程中,开发人员只需要专注于一点, ...

  5. 《Pro Express.js》学习笔记——app.params中间件

    app.param中间件用于对URL中的参数进行获取.加工.输出,提供公有逻辑,以达到代码重构的目的. 以下示例采取三个步骤对代码进行重构,app.param中间件的作用非常明显: 不使用中间件 使用 ...

  6. 【转】【翻】Android Design Support Library 的 代码实验——几行代码,让你的 APP 变得花俏

    转自:http://mrfufufu.github.io/android/2015/07/01/Codelab_Android_Design_Support_Library.html [翻]Andro ...

  7. APP推广入门之AppStore数据分析

    AppStore中有很多数据,但对于一个App推广者而言,最需要关注的无非这么几个,即下载量.评论.权重.榜单排名.搜索排名以及热词搜索等.至于这些数据具体代表着什么,下面就先由下载量开始,来简单介绍 ...

  8. Android Design Support Library 的 代码实验——几行代码,让你的 APP 变得花俏

    原文:Codelab for Android Design Support Library used in I/O Rewind Bangkok session--Make your app fanc ...

  9. 项目在App Store的展示信息

    一.首部1.图标作用:一个软件的logo.修改:每次提交新版本时可以修改.要求:1>1024*1024像素 2>72dpi.RGB.平展.不透明.没有圆角 3>高品质的JPEG或PN ...

随机推荐

  1. c# switch case语句

    switch是一个控制语句,用于选择一个要执行的语句块. 一个switch语句包括一个或多个执行的语句块.每个语句块包括一个或多个case标签,case后接要执行的语句. 如下面的代码 Codeint ...

  2. using(){},Close(),Dispose()的区别

    //用Close(),Dispose()方式关闭连接 string connString = "Data Source=(local);Initial Catalog=Linq;Integr ...

  3. sqlite 数据库打开失败

    今天在做Android电子词典的时候,数据库打不开,报错为:Could not open the database in read/write mode. 后来才发现犯了一个低级错误,没有设置权限. ...

  4. Java 泛型类型的一些限制

    由于泛型类型在运行时被消除,因此,对于如何使用泛型类型是有一些限制的. 限制1:不能使用new E() 不能使用泛型类型参数创建实例.例如,下面的语句是错误的: E object = new E(); ...

  5. 访问权限PPP(public、private、protected、default)之成员变量、成员变量权限解析

    首先,我们需要清楚一下方法是由哪些部分构成的: [权限修饰符列表][别的修饰符列表] 返回值类型 方法名(参数列表){   方法体:} 然后我们需要知道成员变量和成员方法访问有几种情况:1.当前包同一 ...

  6. Java文件操作 读写操作

    一.Java读取文件 案例1:读取D盘的1.txt文件 编码: File file = new File("D:/1.txt"); FileReader fr = new File ...

  7. 浏览器测试功能(jquery1.9以后已取消)

    // 1.9以后取消了msie这些私有方法判断.这里封装加回. var matched = (function(ua) { ua = ua.toLowerCase(); var match = /(o ...

  8. react native学习1-安装,执行

    demo地址 http://www.oschina.net/p/reactnative http://my.oschina.net/luyongfugx/blog/394427#OSC_h1_1 翻译 ...

  9. git之环境配置(window+git+github)

    本地安装git 下载最新版的git:https://msysgit.googlecode.com/files/Git-1.9.0-preview20140217.exe 安装步骤:http://jin ...

  10. Activity的窗口对象(Window)的创建过程分析

    与Activity组件所关联的窗口对象的实际类型为PhoneWindow,后者是从Window类继承下来的. Activity.Window和PhoneWindow三个类的关系如下 PhoneWind ...