其实这种效果很容易实现,谷歌给我们提供了方法,只需要在adapter中重写这个方法就可以了。
/**
* Returns the proportional width of a given page as a percentage of the
* ViewPager's measured width from (0.f-1.f]
返回给定的页面所占ViewPager 测量宽度的比例,范围(0,1]
*
* @param position The position of the page requested
* @return Proportional width for the given page position
*/
public float getPageWidth(int position) {
return 1.f;//默认值
}