gpt4 book ai didi

android - PlayStore新视差效果怎么做

转载 作者:IT王子 更新时间:2023-10-28 23:46:56 25 4
gpt4 key购买 nike

有谁知道我怎样才能实现新的视差滚动效果 - 当您在 PlayStore 上打开应用并尝试向下滚动时,您可以看到效果,内容会超出顶部图像。我怎样才能做到这一点?

enter image description here

最佳答案

Google 最近宣布了 Design support library并且它支持实现折叠工具栏

In addition to pinning a view, you can use app:layout_collapseMode="parallax" (and optionally app:layout_collapseParallaxMultiplier="0.7" to set the parallax multiplier) to implement parallax scrolling (say of a sibling ImageView within the CollapsingToolbarLayout)

例子:

<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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com