Android Put animation in Page scroll in view pager using fragment

前端 未结 1 1030
梦谈多话
梦谈多话 2020-12-16 06:04

I want to put animation(zoom in-out,fade in-out,3d etc) when page scroll in view pager. my code is the following.

My first class:

  public class View         


        
相关标签:
1条回答
  • 2020-12-16 06:43

    You can attach PagerTransformer to ViewPager :

    mViewPager.setPageTransformer(false, new ViewPager.PageTransformer() {
    @Override
    public void transformPage(View page, float position) {
        // do transformation here
        }
    });
    

    You can go through following links which will help you :

    http://developer.android.com/training/animation/screen-slide.html#pagetransformer

    http://andraskindler.com/blog/2013/create-viewpager-transitions-a-pagertransformer-example/

    0 讨论(0)
提交回复
热议问题