首页 > 其他 > 详细

ViewPager留出边 显示左右两边的视图

时间:2019-05-14 19:38:47      阅读:469      评论:0      收藏:0      [点我收藏+]

 

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/pager_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:clipChildren="false"
    android:layerType="software" >

    <android.support.v4.view.ViewPager
        android:id="@+id/view_pager"
        android:layout_width="250dp"
        android:layout_height="450dp"

android:layout_marginLeft="@dimen/size_30px"
android:layout_marginRight="@dimen/size_30px"
android:clipChildren="false" /> </RelativeLayout>

发现上面的RelativeLayout(可以用其它layout替换)和ViewPager的android:clipChildren都设置为了false。

android:clipChildren表示是否限制子View在其范围内,默认为true。

    如此就可以 实现 两边 留边能看见视图的ViewPager

 

ViewPager留出边 显示左右两边的视图

原文:https://www.cnblogs.com/bimingcong/p/10863864.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!