| 注册
请输入搜索内容

热门搜索

Java Linux MySQL PHP JavaScript Hibernate jQuery Nginx
jopen
11年前发布

视差滚动(Parallax Scroll)效果的滚动视图:ParallaxScrollView

ParallaxScrollView实现具有视差滚动(Parallax Scroll)效果的滚动视图。所谓视差滚动,就是屏幕有两层滚动视图,两层滚动视图的滚动速度不一样,一般来说前面的滚动视图的滚动速度比底部的滚动视图的滚动速度要快,从而造成三维滚动效果。可以调整视差滚动参数,参数越小,两层的滚动速度相差越大,视差滚动效果越明显。

<couk.jenxsol.parallaxscrollview.views.ParallaxScrollView xmlns:tools="http://schemas.android.com/tools"      xmlns:android="http://schemas.android.com/apk/res/android"      xmlns:app="http://schemas.android.com/apk/res-auto"      android:layout_width="match_parent"      android:layout_height="match_parent"      app:parallexOffset="0.25" >        <!-- Background -->        <ImageView          android:layout_width="match_parent"          android:layout_height="match_parent"          android:gravity="center"          android:scaleType="fitXY"          android:src="@drawable/bg_sky" />        <!-- Foreground -->      <!-- You can place any of the items below as the foreground, but for most control, add the scroll view yourself. -->        <couk.jenxsol.parallaxscrollview.views.ObservableScrollView          android:layout_width="match_parent"          android:layout_height="match_parent" >            <LinearLayout              android:layout_width="260dp"              android:layout_height="wrap_content"              android:orientation="vertical"              android:paddingBottom="@dimen/spacing"              android:paddingTop="@dimen/spacing" >                <TextView                  android:layout_width="match_parent"                  android:layout_height="wrap_content"                  android:background="@android:color/white"                  android:padding="@dimen/spacing"                  android:text="@string/hello_world" />            </LinearLayout>      </couk.jenxsol.parallaxscrollview.views.ObservableScrollView>    </couk.jenxsol.parallaxscrollview.views.ParallaxScrollView>

项目主页:http://www.open-open.com/lib/view/home/1389766760851

 本文由用户 jopen 自行上传分享,仅供网友学习交流。所有权归原作者,若您的权利被侵害,请联系管理员。
 转载本站原创文章,请注明出处,并保留原始链接、图片水印。
 本站是一个以用户分享为主的开源技术平台,欢迎各类分享!
 本文地址:https://www.open-open.com/lib/view/open1389766760851.html
Android开发 移动开发 ParallaxScrollView