正文

一、效果图

看到这个图时你可以先想想如果是你,你怎么实现这个效果。马上想到用RelativeLayout?NO,NO,NO,,,

二、实现代码


<?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在其范围内

三、 其他

在做动画的时候非常有用,博大精深啊。。。。。。

转:http://www.cnblogs.com/over140/p/3508335.html

Android_神奇的android:clipChildren属性的更多相关文章

  1. 【Android】神奇的android:clipChildren属性

    前言 前几天有在微博上推荐过一个博客,看他文章时发现了这个属性.有些属性不常用,但需要的时候非常有用,于是做了个例子,正好项目用到,与大家分享一下. 声明 欢迎转载,请注明出处! 博客园:http:/ ...

  2. Android开发实战(二十一):浅谈android:clipChildren属性

    实现功能: 1.APP主界面底部模块栏 2.ViewPager一屏多个界面显示 3......... 首先需要了解一下这个属性的意思 ,即 是否允许子View超出父View的返回,有两个值true . ...

  3. android:clipChildren属性的作用

    该属性默认为true,这个属性需要添加到最顶层的ViewGroup,作用是控制子View是否可以超出它所在的父View设定的边界 比如ImageView设置高度100dp,而它所在的父View设置的高 ...

  4. android:clipChildren属性,子布局超出父布局;

    是否允许子View超出父View的范围,Boolean型true .false ,默认true不允许: android:clipChildren="true":如下 android ...

  5. android:clipChildren 属性

    这个属性默认为true: 两个用法: 1.设置为false ,使用ViewPager 的时候能够 实现一屏上显示多个Item 2.动画能越界

  6. 用android:clipChildren来实现红心变大特效

    最近在看别人技术博客(http://www.cnblogs.com/over140/p/3508335.html)的时候,发现一个属性:android:clipChildren属性. 翻文档找到下面介 ...

  7. [转]android:clipToPadding和android:clipChildren

    转自:http://www.tuicool.com/articles/32YRJrq android:clipToPadding和android:clipChildren 时间 2014-10-14 ...

  8. android:clipToPadding和android:clipChildren

    假设我们要做一个效果,界面最顶部是一个ActionBar并且是半透明的,ActionBar下面是一个ListView,在初始状态 下, ListView是top是在ActionBar的bottom位置 ...

  9. android:clipToPadding 和 android:clipChildren 解决ListView设置padding后 padding不跟随改动

    clipToPadding就是说控件的绘制区域是否在padding里面的,true的情况下如果你设置了padding那么绘制的区域就往里 缩, clipChildren是指子控件是否超过padding ...

随机推荐

  1. C#同步数据库的数据到Neo4J

    数据组件采用https://github.com/Readify/Neo4jClient 在nuget里面有 需要注意的是 以下是示例代码: using System;using System.Col ...

  2. 云支付整合Tp3.2.3代码整理

    可能比较少的项目用会用到云支付,我之前有个项目就用这个支付,相对于微信支付和支付宝支付他名气太小了,但是很多支付宝或者微信审核不下来就回选择这种支付方式,总体开发比较简单.云支付官网是这么说的“云支付 ...

  3. Dubbo使用详解及环境搭建

    一:Dubbo简介 Dubbo是阿里巴巴提供的开源的SOA(面向服务的体系结构)服务化治理的技术框架,据说只是一部分开源的,但一些基本的需求已经可以满足的,而且可扩展性.是一种能取代PHRPC的服务调 ...

  4. python核心编程-第三章-个人笔记

    1.语句和语法 (1)反斜杠"\"表示语句继续.python良好的编程习惯是一行最后不超过80个字符,一行字符过多时便须用到反斜杠换行继续该语句. PS:在使用小括号.中括号.大括 ...

  5. PHP环境搭配

    电脑上如果有apache,必须先卸载了先,如果有集成的环境,类似于apmserver,也必须先停止先.不然安装的时候,会出现修复和卸载选项,而不是典型安装跟用户自定义安装. apache安装目录 E: ...

  6. ICE-3.5.1-错误记录

    windwos上QT5使用ICE中遇到的一个小bug: error: C3083: “Stm”:“::”左侧的符号必须是一种类型error: C2039: “upCast”: 不是“IceProxy” ...

  7. JS 禁止浏览器右键菜单和刷新

    <script language="javascript"> //禁止按键F5 document.onkeydown = function(e){ e = window ...

  8. javascript对象继承的实现

    现在有两个对象,需要实现Chinese类型对象对Person类型对象的继承. 这里分两部分,属性和方法. 属性可以直接用构造函数的方法实现继承,而方法则要通过原型链来实现继承. 先解释什么是原型链,每 ...

  9. android透明度和css透明度

    值越小,越透明 css:0.1-------1 android:#00-----------#ff

  10. haproxy hdr和path

    path : string This extracts the request's URL path, which starts at the first slash and ends before ...