ViewPager - get a partial view of the next page

后端 未结 5 712
既然无缘
既然无缘 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 11:59

    You can try adding this to your PageAdapter:

    public float getPageWidth(int position) {
        if (position == 0 || position == 2) {
            return 0.8f;
        }
        return 1f;
    }
    

提交回复
热议问题