Skip to content

livesun/ParallaxViewPager

Repository files navigation

ParallaxViewPager

视差视图框架 只需要一句代码即可实现

效果图:

image

使用:

1、依赖

allprojects {	repositories {	...	maven { url 'https://www.jitpack.io' }	}	}	dependencies { compile 'com.github.livesun:ParallaxViewPager:v1.0'	} 

2、传入布局id数组。

mViewPager.setLayout(getSupportFragmentManager(), new int[]{R.layout.activity_test,R.layout.activity_kotlin,R.layout.activity_user_info});

3、xml文件中,为需要移动的控件配置属性

 <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" app:translationXIn="0.12" app:translationYIn="0.82" app:translationYOut="0.82" app:translationXOut="0.12" />

如果 想要按钮,可以通过监听viewpager的滑动,到最后一页把按钮展示出来  上面有demo 可以看demo的实现

博客   地址:https://livesun.github.io/2017/10/11/ParallaxViewPager/

About

视差视图框架 只需要一句代码即可实现

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages