ViewPager - get a partial view of the next page

后端 未结 5 706
既然无缘
既然无缘 2020-12-07 11:32

I am trying to achieve this in a ViewPager

The first fragment (blue) is displayed and the beginning of the next fragment must be displayed as well, so the user under

5条回答
  •  情深已故
    2020-12-07 12:08

    This function worked better than the answer marked as correct (for me anyway).

    @Override
    public float getPageWidth(int position) {
        return 0.9f;
    }
    

    Just place it in your custom PagerAdapter class.

提交回复
热议问题