ViewPager的 OnPagechangerListener的三个回调


myViewPager.setOnPageChangeListener(new OnPageChangeListener() {
054
             
055
            @Override
056
            public void onPageSelected(int arg0) {
057
                Log.d("k", "onPageSelected - " + arg0);
058
                //activity从1到2滑动,2被加载后掉用此方法
059
               
062
            }
063
             
064
            @Override
065
            public void onPageScrolled(int arg0, float arg1, int arg2) {
066
                Log.d("k", "onPageScrolled - " + arg0);
067
                //从1到2滑动,在1滑动前调用//arg1:滑动轨迹x 占屏幕的的比列 arg2 滑动轨迹大长度
068
            }
069
             
070
            @Override
071
            public void onPageScrollStateChanged(int arg0) {
072
                Log.d("k", "onPageScrollStateChanged - " + arg0);
073
                //状态有三个0空闲,1是增在滑行中,2目标加载完毕
074
                /**
075
                 * Indicates that the pager is in an idle, settled state. The current page
076
                 * is fully in view and no animation is in progress.
077
                 */
078
                //public static final int SCROLL_STATE_IDLE = 0;
079
                /**
080
                 * Indicates that the pager is currently being dragged by the user.
081
                 */
082
                //public static final int SCROLL_STATE_DRAGGING = 1;
083
                /**
084
                 * Indicates that the pager is in the process of settling to a final position.
085
                 */
086
                //public static final int SCROLL_STATE_SETTLING = 2;
087


088
            }
089
        });
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值