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

如何讓安卓(Android)子控件超出父控件的范圍顯示

 更新時間:2016年08月04日 17:29:55   投稿:daisy  
下面我們來看一下關(guān)于安卓(Android)子控件超出父控件的范圍顯示出來的方法,希望這篇文章能夠幫助到各位安卓(Android)的開發(fā)者們,有碰到此問題的朋友可以進(jìn)來看看哦。

先來看一張預(yù)覽圖:

 

廢話不多說,直接上代碼:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
 android:layout_width="match_parent"
 android:layout_height="match_parent"
 android:clipChildren="false">
 
 <ImageView
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:layout_marginBottom="60dp"
  android:background="@mipmap/www" />
 
 
 <LinearLayout
  android:id="@+id/ll_bottom"
  android:layout_width="match_parent"
  android:layout_height="60dp"
  android:layout_alignParentBottom="true"
  android:background="#F8549D"
  android:elevation="10dp"
  android:orientation="horizontal">
 
  <RelativeLayout
   android:layout_width="0dp"
   android:layout_height="match_parent"
   android:layout_gravity="bottom"
   android:layout_weight="1">
 
   <ImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerInParent="true"
    android:src="@mipmap/ic_launcher" />
 
  </RelativeLayout>
 
  <RelativeLayout
   android:layout_width="0dp"
   android:layout_height="match_parent"
   android:layout_gravity="bottom"
   android:layout_weight="1">
 
   <ImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerInParent="true"
    android:src="@mipmap/ic_launcher" />
 
  </RelativeLayout>
 
  <RelativeLayout
   android:layout_width="70dp"
   android:layout_height="70dp"
   android:layout_gravity="bottom"
   android:background="@drawable/bottom_bg_shape">
 
   <ImageView
    android:layout_width="30dp"
    android:layout_height="30dp"
    android:layout_centerInParent="true"
    android:src="@mipmap/icon_go" />
 
  </RelativeLayout>
 
 
  <RelativeLayout
   android:layout_width="0dp"
   android:layout_height="match_parent"
   android:layout_gravity="bottom"
   android:layout_weight="1">
 
   <ImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerInParent="true"
    android:src="@mipmap/ic_launcher" />
 
  </RelativeLayout>
 
  <RelativeLayout
   android:layout_width="0dp"
   android:layout_height="match_parent"
   android:layout_gravity="bottom"
   android:layout_weight="1">
 
   <ImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_centerInParent="true"
    android:src="@mipmap/ic_launcher" />
 
  </RelativeLayout>
 </LinearLayout>
 
</RelativeLayout>
 

這張圖呢是我剛剛做的,效果是參考了酷狗音樂播放器來完成的,我想說明重點在底部的導(dǎo)航欄:如圖

 

再來一張反效果預(yù)覽圖:

 

如何使得藍(lán)色圓形的播放鍵的顯示越過粉色的范圍。當(dāng)然經(jīng)過合理的布局是可以達(dá)到這樣的效果的,但是卻有更簡單的方法。也就是在根布局的屬性中加入一個來自Android自身提供的屬性:

android:clipChildren="false"

屬性解釋和說明:

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

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

    3、只需在根節(jié)點設(shè)置android:clipChildren為false即可,默認(rèn)為true

總結(jié)

以上就是如何讓安卓(Android)子控件超出父控件的范圍顯示出來的全部內(nèi)容,大家學(xué)會了嗎?希望本文可以幫助到各位。

相關(guān)文章

  • Android 通知欄的使用方法

    Android 通知欄的使用方法

    不同版本通知欄的創(chuàng)建方式不盡相同,當(dāng)前官方推薦使用 NotificationCompat 相關(guān)的API,兼容到Android 4.0,但是部分新功能,比如內(nèi)嵌回復(fù)操作,舊版本是無法支持的。
    2021-05-05
  • Flutter 分頁功能表格控件詳細(xì)解析

    Flutter 分頁功能表格控件詳細(xì)解析

    這篇文章主要介紹了Flutter 分頁功能表格控件詳細(xì)解析,本文通過實例代碼給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下
    2020-04-04
  • Android性能圖論在啟動優(yōu)化中的應(yīng)用示例詳解

    Android性能圖論在啟動優(yōu)化中的應(yīng)用示例詳解

    這篇文章主要為大家介紹了Android性能圖論在啟動優(yōu)化中的應(yīng)用示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2022-10-10
  • Android Flutter實現(xiàn)自定義下拉刷新組件

    Android Flutter實現(xiàn)自定義下拉刷新組件

    在Flutter開發(fā)中官方提供了多平臺的下拉刷新組件供開發(fā)者使用。本文將改造一下這些組件,實現(xiàn)自定義的下拉刷新組件,感興趣的可以了解一下
    2022-08-08
  • android開發(fā)框架afinal使用方法小結(jié)

    android開發(fā)框架afinal使用方法小結(jié)

    這篇文章主要為大家詳細(xì)總結(jié)了android開發(fā)框架afinal使用方法,注解功能、文件上傳下載功能,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2016-11-11
  • Android RadioButton單選框的使用方法

    Android RadioButton單選框的使用方法

    本篇文章小編為大家介紹,Android RadioButton單選框的使用方法。需要的朋友參考下
    2013-04-04
  • android仿直播圓點加載效果

    android仿直播圓點加載效果

    這篇文章主要為大家詳細(xì)介紹了android仿直播圓點加載效果,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2018-07-07
  • Android繪制音樂播放器示波器

    Android繪制音樂播放器示波器

    這篇文章主要為大家詳細(xì)介紹了Android繪制音樂播放器示波器的相關(guān)資料,感興趣的小伙伴們可以參考一下
    2016-07-07
  • kotlin使用建造者模式自定義對話框

    kotlin使用建造者模式自定義對話框

    這篇文章主要為大家詳細(xì)介紹了kotlin使用建造者模式自定義對話框的相關(guān)資料,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2018-07-07
  • ViewPager 與 Fragment相結(jié)合實現(xiàn)微信界面實例代碼

    ViewPager 與 Fragment相結(jié)合實現(xiàn)微信界面實例代碼

    這篇文章主要介紹了ViewPager 與 Fragment相結(jié)合實現(xiàn)微信界面實例代碼的相關(guān)資料,需要的朋友可以參考下
    2016-07-07

最新評論