材料设计清单:隐藏在滚动应用栏?清单、材料

2023-09-05 02:57:44 作者:做一个花心的骑士。

每全新的Andr​​oid材质设计清单:

Per the new Android Material Design checklist:

http://android-developers.blogspot.com/2014/10/material-design-on-android-checklist.html

在适当情况下,在向下滚动,应用栏可以在屏幕上滚过,留下更多的垂直空间的内容。一旦滚动起来之后,应用栏应该再次显示。

Where appropriate, upon scrolling down, the app bar can scroll off the screen, leaving more vertical space for content. Upon scrolling back up, the app bar should be shown again.

我知道有很多问题/答案实现对ICS风格的应用程序栏这种行为,但我很好奇,如果新的工具栏插件或棒棒糖/ AppCompat 21已经推出实现这种效果的更标准的方式。

I realize there are lots of questions/answers to implement this behavior for the ICS-style app bar, but I'm curious if the new Toolbar widget or Lollipop/AppCompat 21 have introduced a more standard way of achieving this effect.

推荐答案

每罗马Nurik在Google+上(基本上就是@tyczj提到)

Per Roman Nurik on Google+ (essentially what @tyczj mentioned)

https://plus.google.com/u/0/+ RomanNurik /职位/ 3G8zYvN5oRC

这不是内置的,但实现起来比较简单。只是观察滚动和动画的Y平移。也可以使用速回样品+尼克·布彻,我出版了一本几年前

It's not built in but relatively simple to implement. Just observe scrolling and animate the Y translation. Could also use the "quick return" sample +Nick Butcher​ and I published a few years ago

我认为引用了例子: https://开头code。 google.com/p/romannurik-$c$c/source/browse/misc/scrolltricks

I believe that example referenced is: https://code.google.com/p/romannurik-code/source/browse/misc/scrolltricks

更新:我也只是发现了一个伟大的图书馆,这是否与其他一些伟大的技巧,以及的https:/ /github.com/ksoichiro/Android-ObservableScrollView

UPDATE: I also just discovered a great library that does this, along with some other great tricks https://github.com/ksoichiro/Android-ObservableScrollView