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

Android 中clipToPadding 和 clipChildren區(qū)別和作用

 更新時間:2017年06月07日 16:43:55   投稿:lqh  
這篇文章主要介紹了Android 中clipToPadding 和 clipChildren區(qū)別和作用的相關(guān)資料,需要的朋友可以參考下

Android 中clipToPadding 和 clipChildren區(qū)別和作用

Android 關(guān)于 clipToPadding clipChildren區(qū)別和作用對于這兩個屬性那也是很神奇,

1.對于clipToPadding 默認(rèn)是true, 這個屬性一般都是viewgrounp對象才會用到, 他的意思就是 對于padding 所占的尺寸大小也繪制 其他的item的view,

2.對于clipChildren 默認(rèn)是true,這個屬性是讓子view不受父view大小的限制,可以超過父view的寬高,延伸到周圍view內(nèi)部

下面放入效果圖:

第一個布局是:viewpager 讓兩邊的縮進(jìn)的同時讓其他的也顯示一部分,這種效果,就會用到 clipToPadding = false屬性

這個布局就用到了clipChildren = false,能讓flatbutton從上面布局延伸到周圍的布局內(nèi)部而不被覆蓋,例如下面的布局也是

以上基本都是這兩個屬性的區(qū)別;例子

<?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>


感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持!

相關(guān)文章

  • Android Studio 配置忽略文件的方法實(shí)現(xiàn)

    Android Studio 配置忽略文件的方法實(shí)現(xiàn)

    這篇文章主要介紹了Android Studio 配置忽略文件的方法實(shí)現(xiàn),文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2020-10-10
  • Android串口開發(fā)之使用JNI實(shí)現(xiàn)ANDROID和串口通信詳解

    Android串口開發(fā)之使用JNI實(shí)現(xiàn)ANDROID和串口通信詳解

    這篇文章主要給大家介紹了關(guān)于Android串口開發(fā)之使用JNI實(shí)現(xiàn)ANDROID和串口通信的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧。
    2018-01-01
  • Android自定義View實(shí)現(xiàn)折線圖效果

    Android自定義View實(shí)現(xiàn)折線圖效果

    這篇文章介紹的是一個折線圖控件,用來顯示一系列的狀態(tài),并可以進(jìn)行滑動。有需要的可以參考借鑒。
    2016-08-08
  • Android仿正點(diǎn)鬧鐘時間齒輪滑動效果

    Android仿正點(diǎn)鬧鐘時間齒輪滑動效果

    這篇文章主要為大家詳細(xì)介紹了Android仿正點(diǎn)鬧鐘時間齒輪滑動效果,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2018-01-01
  • Android開發(fā)之自定義CheckBox

    Android開發(fā)之自定義CheckBox

    本文通過實(shí)例代碼演示如何在Android中如何自定義CheckBox,實(shí)現(xiàn)的效果很好,有需要的可以參考借鑒。
    2016-08-08
  • 5步教你快速寫一個android Router路由框架

    5步教你快速寫一個android Router路由框架

    本篇文章主要介紹了5步教你快速寫一個Router路由框架(詳細(xì)步驟),小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2017-11-11
  • Android使用ViewPager實(shí)現(xiàn)翻頁效果

    Android使用ViewPager實(shí)現(xiàn)翻頁效果

    這篇文章主要為大家詳細(xì)介紹了Android使用ViewPager實(shí)現(xiàn)翻頁效果,文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2022-05-05
  • Android miniTwitter登錄界面開發(fā)實(shí)例

    Android miniTwitter登錄界面開發(fā)實(shí)例

    這篇文章主要為大家詳細(xì)介紹了Android miniTwitter登錄界面開發(fā)實(shí)例,感興趣的小伙伴們可以參考一下
    2016-04-04
  • Android常用的圖片加載庫

    Android常用的圖片加載庫

    本文主要介紹了Android常用的圖片加載庫的相關(guān)資料。具有很好的參考價值。下面跟著小編一起來看下吧
    2017-04-04
  • 利用Kotlin的協(xié)程實(shí)現(xiàn)簡單的異步加載詳解

    利用Kotlin的協(xié)程實(shí)現(xiàn)簡單的異步加載詳解

    這篇文章主要給大家介紹了關(guān)于利用Kotlin的協(xié)程實(shí)現(xiàn)簡單的異步加載的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧。
    2018-03-03

最新評論