视差效果:RealParallaxAndroid

jopen 8年前

视差效果:RealParallaxAndroid 。背景图为一张图片的实景视差效果。

使用说明:

<com.github.hmallet.realparallaxandroid.RealHorizontalScrollView  android:id="@+id/main_horizontal_scrollview"  android:layout_width="match_parent"  android:layout_height="match_parent"  app:src="@mipmap/background"/>    <com.github.hmallet.realparallaxandroid.RealViewPager  android:id="@+id/main_view_pager"  android:layout_width="match_parent"  android:layout_height="match_parent"  app:parallaxVelocity="0.2"/>

 

RealHorizontalScrollView自定义属性

  • app:src

RealViewPager自定义属性

  • parallaxVelocity float to manage parallax effect

Gradle

 build.gradle:

dependencies {      compile 'com.github.hmallet:realparallaxandroid:1.0.1'  }

 

项目地址: https://github.com/mallethugo/RealParallaxAndroid