• clipChildren属性


    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:clipChildren="false"
        android:orientation="vertical" >
    
        <android.support.v4.view.ViewPager
            android:id="@+id/view_pager"
            android:layout_width="match_parent"
            android:layout_height="0dip"
            android:layout_weight="1.0" />
    
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="48dip"
            android:background="#B0C4DE"
            android:orientation="horizontal" >
    
            <ImageView
                android:layout_width="0dip"
                android:layout_height="fill_parent"
                android:layout_weight="1.0"
                android:scaleType="fitCenter"
                android:src="@drawable/ic_launcher" />
    
            <ImageView
                android:layout_width="0dip"
                android:layout_height="fill_parent"
                android:layout_weight="1.0"
                android:scaleType="fitCenter"
                android:src="@drawable/ic_launcher" />
    
            <ImageView
                 android:layout_width="0dip"
                android:layout_height="64dip"
                android:layout_gravity="bottom"
                android:layout_weight="1.0"
                android:scaleType="fitCenter"
                android:src="@drawable/ic_launcher" />
    
            <ImageView
                android:layout_width="0dip"
                android:layout_height="fill_parent"
                android:layout_weight="1.0"
                android:scaleType="fitCenter"
                android:src="@drawable/ic_launcher" />
    
            <ImageView
                android:layout_width="0dip"
                android:layout_height="fill_parent"
                android:layout_weight="1.0"
                android:scaleType="fitCenter"
                android:src="@drawable/ic_launcher" />
        </LinearLayout>
    
    </LinearLayout>
    

    代码说明:

    1、只需在根节点设置android:clipChildren为false即可,默认为true

    2、可以通过android:layout_gravity控制超出的部分如何显示。

    3、android:clipChildren的意思:是否限制子View在其范围内

  • 相关阅读:
    在TNSNAMES.ORA文件中配置本机装的oracle
    Eclipse编辑jsp、js文件时,经常出现卡死现象解决汇总
    ExtJs GridPanel 给表格行或者单元格自定义样式
    Ext.core.DomQuery Dom选择器
    JavaScript 常用方法
    ExtJs Ext.data.Model 学习笔记
    JavaScript 深入理解作用域链
    Spring 网路搜集的情报
    SpringMVC 之类型转换Converter详解转载
    SpringMVC @RequestMapping 用法详解之地址映射
  • 原文地址:https://www.cnblogs.com/ganchuanpu/p/6701329.html
Copyright © 2020-2023  润新知