android - PlayStore新视差效果怎么做

标签 android android-layout android-animation material-design android-scroll

有谁知道我怎样才能实现新的视差滚动效果 - 当您在 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/

相关文章:

android - 如何在google play控制台正确填写权限声明表?

android - 如何在 android 中使用 facebook sdk 4.0 获取 Facebook Feeds(发布)?

java - 如何从处理程序获取数据

Android Studio Google Map V2 fragment 渲染

android - 自定义用户界面不工作

android - 容器 'Android Dependencies' 引用了不存在的库

android - 场景过渡动画上的 JNI 错误 - 图层超过最大值

java - 如何导航回 Activity 并重新启动它?

Android Fragment Transition - 动画期间避免GC

android - 使用 Linearlayout 在 Framelayout 中将元素放置在其他元素下方