欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Android clipChildren屬性實(shí)例詳解

 更新時(shí)間:2016年07月21日 16:19:58   投稿:lqh  
本文主要介紹Android clipChildren的屬性,這里對(duì)clipChildren屬性做了一個(gè)小例子,展示了效果圖和實(shí)例代碼,方便大家觀看理解

前言

 前幾天有在微博上推薦過一個(gè)博客,看他文章時(shí)發(fā)現(xiàn)了這個(gè)屬性。有些屬性不常用,但需要的時(shí)候非常有用,于是做了個(gè)例子,正好項(xiàng)目用到,與大家分享一下。

 正文

 一、效果圖

  看到這個(gè)圖時(shí)你可以先想想如果是你,你怎么實(shí)現(xiàn)這個(gè)效果。馬上想到用RelativeLayout?NO,NO,NO,,,

 二、實(shí)現(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é)點(diǎn)設(shè)置android:clipChildren為false即可,默認(rèn)為true。

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

   3、android:clipChildren的意思:是否限制子View在其范圍內(nèi)。

結(jié)束:

        以上例子在做Android 動(dòng)畫的時(shí)候非常有用,有需要的朋友可以參考下。

相關(guān)文章

  • 詳解MVP模式在Android開發(fā)中的應(yīng)用

    詳解MVP模式在Android開發(fā)中的應(yīng)用

    MVP是MVC衍生而來的,很早以前就由某軟公司提出,近年來在Android應(yīng)用開發(fā)中越來越多的被提及,越來越重要了。這篇文章主要介紹了詳解MVP模式在Android開發(fā)中的應(yīng)用,有興趣的可以了解一下。
    2016-11-11
  • Android快速開發(fā)之定制BaseTemplate

    Android快速開發(fā)之定制BaseTemplate

    這篇文章主要為大家詳細(xì)介紹了Android快速開發(fā)之定制BaseTemplate的相關(guān)資料,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2017-02-02
  • Android截取視頻幀并轉(zhuǎn)化為Bitmap示例

    Android截取視頻幀并轉(zhuǎn)化為Bitmap示例

    利用MediaMetadataRetriever按照時(shí)間截取視頻并轉(zhuǎn)換為Bitmap存放于SDCard,具體實(shí)現(xiàn)如下,感興趣的朋友可以參考下哈
    2013-06-06
  • Android OKHttp源碼解析Https安全處理

    Android OKHttp源碼解析Https安全處理

    這篇文章主要為大家介紹了Android OKHttp源碼解析Https安全處理詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2022-12-12
  • Android利用MPAndroidChart繪制曲線圖表的基礎(chǔ)教程

    Android利用MPAndroidChart繪制曲線圖表的基礎(chǔ)教程

    最近在項(xiàng)目中要用到曲線圖,于是在網(wǎng)上找了很多很多,有AChartengine,MPAndroidChart,helloChart等等,我還用過基于html5的jsChart來做過,不過最終還是選擇了MPAndroidChart來做本文介紹了Android利用MPAndroidChart繪制曲線圖表的基礎(chǔ)教程,需要的朋友可以參考下。
    2018-03-03
  • android使用url connection示例(get和post數(shù)據(jù)獲取返回?cái)?shù)據(jù))

    android使用url connection示例(get和post數(shù)據(jù)獲取返回?cái)?shù)據(jù))

    這篇文章主要介紹了android使用URLConnection來get和post數(shù)據(jù)獲取返回的數(shù)據(jù),大家參考使用吧
    2014-01-01
  • Android開發(fā)常見問題總結(jié)

    Android開發(fā)常見問題總結(jié)

    這篇文章主要介紹了Android開發(fā)常見問題,總結(jié)分析了諸如界面設(shè)計(jì)、多媒體調(diào)用、圖片、動(dòng)畫操作等開發(fā)中常見的問題解決方法與相關(guān)注意事項(xiàng),需要的朋友可以參考下
    2016-08-08
  • 淺談Android應(yīng)用安全防護(hù)和逆向分析之a(chǎn)pk反編譯

    淺談Android應(yīng)用安全防護(hù)和逆向分析之a(chǎn)pk反編譯

    我們有時(shí)候在某個(gè)app上見到某個(gè)功能,某個(gè)效果蠻不錯(cuò)的,我們想看看對(duì)方的思路怎么走的,這時(shí)候,我們就可以通過反編譯來編譯該apk,拿到代碼,進(jìn)行分析。
    2021-06-06
  • 揭秘雙十一手機(jī)淘寶圖標(biāo)如何被動(dòng)態(tài)更換

    揭秘雙十一手機(jī)淘寶圖標(biāo)如何被動(dòng)態(tài)更換

    這篇文章主要介紹了每到雙十一十二的時(shí)候Android手機(jī)動(dòng)態(tài)更換手機(jī)圖標(biāo)的方法,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2021-08-08
  • Android?NDK入門初識(shí)(組件結(jié)構(gòu)開發(fā)流程)

    Android?NDK入門初識(shí)(組件結(jié)構(gòu)開發(fā)流程)

    這篇文章主要為大家介紹了Android?NDK入門之初識(shí)組件結(jié)構(gòu)開發(fā)流程詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2023-08-08

最新評(píng)論