Android布局之幀布局FrameLayout詳解
FrameLayout
在這個(gè)布局中,所有的子元素都不能被指定放置的位置,他們統(tǒng)統(tǒng)防御這塊區(qū)域的左上角,
并且后面的子元素直接覆蓋在前面的子元素之上,將前面的子元素部分和全部遮擋。
用途
常用于進(jìn)度條的表示
<?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <TextView android:layout_gravity="center" android:background="#687564" android:id="@+id/textView" android:layout_width="300dp" android:layout_height="300dp" android:text="第一個(gè)" /> <TextView android:layout_gravity="center" android:background="#422322" android:id="@+id/textView2" android:layout_width="200dp" android:layout_height="200dp" android:text="第二個(gè)" /> <TextView android:layout_gravity="center" android:background="#f1f1f1" android:id="@+id/textView3" android:layout_width="100dp" android:layout_height="100dp" android:text="第三個(gè)" /> <TextView android:layout_gravity="center" android:background="#f22" android:id="@+id/textView4" android:layout_width="80dp" android:layout_height="80dp" android:text="第四個(gè)" /> </FrameLayout>
<?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <ProgressBar android:layout_gravity="center" android:id="@+id/progressBar" style="?android:attr/progressBarStyle" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <TextView android:layout_gravity="center" android:id="@+id/textView5" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="%20" /> </FrameLayout>
以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
Android四大組件之Service(服務(wù))實(shí)例詳解
這篇文章主要介紹了Android四大組件之Service(服務(wù))的用法,結(jié)合實(shí)例形式詳細(xì)分析了Service的基本概念,類(lèi)型,用法與相關(guān)注意事項(xiàng),需要的朋友可以參考下2016-01-01Android編程實(shí)現(xiàn)二維碼的生成與解析
這篇文章主要介紹了Android編程實(shí)現(xiàn)二維碼的生成與解析方法,結(jié)合實(shí)例分析了Android二維碼的生成與讀取二維碼的相關(guān)技巧,并提供了二維碼jar包供讀者下載,需要的朋友可以參考下2015-11-11flutter開(kāi)發(fā)技巧自定頁(yè)面指示器PageIndicator詳解
這篇文章主要為大家介紹了flutter開(kāi)發(fā)技巧自定頁(yè)面指示器PageIndicator詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2023-01-01Android開(kāi)發(fā)必知 九種對(duì)話(huà)框的實(shí)現(xiàn)方法
App中少不了與用戶(hù)交互的各種dialog,以此達(dá)到很好的用戶(hù)體驗(yàn),下面給大家介紹Android開(kāi)發(fā)必知 九種對(duì)話(huà)框的實(shí)現(xiàn)方法,有需要的朋友可以參考下2015-08-08修改Android FloatingActionButton的title的文字顏色及背景顏色實(shí)例詳解
這篇文章主要介紹了修改Android FloatingActionButton的title的文字顏色及背景顏色實(shí)例詳解的相關(guān)資料,需要的朋友可以參考下2017-03-03Android 使用mediaplayer播放res/raw文件夾中的音樂(lè)的實(shí)例
這篇文章主要介紹了Android 使用mediaplayer播放res/raw文件夾中的音樂(lè)的實(shí)例的相關(guān)資料,需要的朋友可以參考下2017-04-04Android 自定義view模板并實(shí)現(xiàn)點(diǎn)擊事件的回調(diào)
這篇文章主要介紹了Android 自定義view模板并實(shí)現(xiàn)點(diǎn)擊事件的回調(diào)的相關(guān)資料,需要的朋友可以參考下2017-01-01詳解Android ContentProvider的基本原理和使用
ContentProvider(內(nèi)容提供者)是 Android 的四大組件之一,管理 Android 以結(jié)構(gòu)化方式存放的數(shù)據(jù),以相對(duì)安全的方式封裝數(shù)據(jù)(表)并且提供簡(jiǎn)易的處理機(jī)制和統(tǒng)一的訪問(wèn)接口供其他程序調(diào)用2021-06-06