Android_Scroller类_用法


-2016/3/23-
@作者 : 西野奈留
@博客:http://blog.csdn.net/narunishino


执行顺序:

1. mScroll.startScroll (int startX, int startY, int dx, int dy, int duration)
* 作用:就是一个开始按钮,并设定好目的地坐标,(option:移动到目的地的时长)
* int dx, int dy:移动量(offset)

2. computeScroll()
* 作用:根据已经移动的距离来判断是否到达目的地,未到达的话就继续移动。
* mScroll.getCurrX(),mScroll.getCurrY():获取已经移动的距离

执行如下:
mScroll.startScroll
03-23 13:40:17.461 28896-28896/? V/CircleAnd…_ScrollLayoutView: …..>>>
computeScroll()
03-23 13:40:17.468 28896-28896/? V/CircleAnd…_ScrollLayoutView: >>>>>>-2>>>>0
03-23 13:40:17.485 28896-28896/? V/CircleAnd…_ScrollLayoutView: >>>>>>-23>>>>0
03-23 13:40:17.501 28896-28896/? V/CircleAnd…_ScrollLayoutView: >>>>>>-52>>>>0
03-23 13:40:17.519 28896-28896/? V/CircleAnd…_ScrollLayoutView: >>>>>>-72>>>>0
03-23 13:40:17.535 28896-28896/? V/CircleAnd…_ScrollLayoutView: >>>>>>-83>>>>0
03-23 13:40:17.552 28896-28896/? V/CircleAnd…_ScrollLayoutView: >>>>>>-91>>>>0
03-23 13:40:17.569 28896-28896/? V/CircleAnd…_ScrollLayoutView: >>>>>>-94>>>>0
03-23 13:40:17.585 28896-28896/? V/CircleAnd…_ScrollLayoutView: >>>>>>-97>>>>0
03-23 13:40:17.601 28896-28896/? V/CircleAnd…_ScrollLayoutView: >>>>>>-98>>>>0
03-23 13:40:17.618 28896-28896/? V/CircleAnd…_ScrollLayoutView: >>>>>>-99>>>>0
03-23 13:40:17.635 28896-28896/? V/CircleAnd…_ScrollLayoutView: >>>>>>-99>>>>0
03-23 13:40:17.651 28896-28896/? V/CircleAnd…_ScrollLayoutView: >>>>>>-100>>>>0
03-23 13:40:17.668 28896-28896/? V/CircleAnd…_ScrollLayoutView: >>>>>>-100>>>>0
03-23 13:40:17.684 28896-28896/? V/CircleAnd…_ScrollLayoutView: >>>>>>-100>>>>0
03-23 13:40:17.701 28896-28896/? V/CircleAnd…_ScrollLayoutView: >>>>>>-100>>>>0
03-23 13:40:17.718 28896-28896/? V/CircleAnd…_ScrollLayoutView: >>>>>>-100>>>>0


-End-


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值