Android_神奇的android:clipChildren属性
生活随笔
收集整理的這篇文章主要介紹了
Android_神奇的android:clipChildren属性
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
正文
一、效果圖
看到這個圖時你可以先想想如果是你,你怎么實現(xiàn)這個效果。馬上想到用RelativeLayout?NO,NO,NO,,,
?
二、實現(xiàn)代碼
<?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、只需在根節(jié)點設(shè)置android:clipChildren為false即可,默認(rèn)為true
2、可以通過android:layout_gravity控制超出的部分如何顯示。
3、android:clipChildren的意思:是否限制子View在其范圍內(nèi)
?
三、 其他
在做動畫的時候非常有用,博大精深啊。。。。。。
?
轉(zhuǎn):http://www.cnblogs.com/over140/p/3508335.html
總結(jié)
以上是生活随笔為你收集整理的Android_神奇的android:clipChildren属性的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Struts2 整合jQuery实现Aj
- 下一篇: I2C总线及AT24C02读写实验报告