xml:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clipChildren="false">
<android.support.v4.view.ViewPager
android:id="@+id/viewPager"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="40dp"
android:layout_marginRight="40dp"
android:clipChildren="false"
/>

</RelativeLayout>

Activity中:
viewHolder.vp.setOffscreenPageLimit(3);
viewHolder.vp.setPageMargin(xxx);
 
posted on 2016-06-06 15:41  Snow〃冰激凌  阅读(335)  评论(0编辑  收藏  举报