1. 效果图

2. 布局文件
主要使用的 android:clipChildren的意思:是否限制子View在其范围内。再父布局和viewpager中设置该属性 ,要显示三个界面 ,还要设置marginleft和marginRight
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:clipChildren="false" > <android.support.v4.view.ViewPager android:id="@+id/vp" android:layout_width="match_parent" android:clipChildren="false" android:layout_marginTop="30dp" android:layout_marginLeft="60dp" android:layout_marginRight="60dp" android:layout_height="150dp"></android.support.v4.view.ViewPager> </RelativeLayout>
讯享网

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/19558.html