有谁知道我怎样才能实现新的视差滚动效果 - 当您在 PlayStore 上打开应用并尝试向下滚动时,您可以看到效果,内容会超出顶部图像。我怎样才能做到这一点?
最佳答案
Google 最近宣布了 Design support library并且它支持实现折叠工具栏。
In addition to pinning a view, you can use
app:layout_collapseMode="parallax"
(and optionallyapp:layout_collapseParallaxMultiplier="0.7"
to set the parallax multiplier) to implement parallax scrolling (say of a sibling ImageView within theCollapsingToolbarLayout
)
例子:
<android.support.design.widget.AppBarLayout
android:layout_height="192dp"
android:layout_width="match_parent">
<android.support.design.widget.CollapsingToolbarLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<android.support.v7.widget.Toolbar
android:layout_height="?attr/actionBarSize"
android:layout_width="match_parent"
app:layout_collapseMode="pin"/>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
关于android - PlayStore新视差效果怎么做,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25461014/