Multiple pages at the same time on a ViewPager

前端 未结 8 1428
执念已碎
执念已碎 2020-12-07 09:58

Is there a possibility to display two pages at the same time, when using a ViewPager? I\'m not looking for an edge effect, but rather for two full

8条回答
  •  离开以前
    2020-12-07 10:33

    You have to override the getPageWidth() method on the viewpager's Adapter. For Example:

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

    Try that code in your Adapter and then you'll understand.

提交回复
热议问题