個人知識總結:View篇--FrameLayout

FrameLayout is designed to block out an area on the screen to display a single item. Generally, FrameLayout should be used to hold a single child view, because it can be difficult to organize child views in a way that's scalable to different screen sizes without the children overlapping each other. You can, however, add multiple children to a FrameLayout and control their position within the FrameLayout by assigning gravity to each child, using the attribute "android:layout_gravity".

以上是Google api對于FrameLayout的介紹,F(xiàn)rameLayout(幀布局)通常情況下所有的子布局都是顯示在布局的左上角,根據(jù)直接子布局順序依次顯示出來,當然子布局可以通過"android:layout_gravity"屬性來確定自身在父布局的位置。通常情況下,F(xiàn)rameLayout是用來和Fragment聯(lián)合使用的,主要用于在Activity里面加入Fragment(碎片)的。

FrameLayout的屬性
* android:foreground:設置幀布局容器的前景圖像
* android:foregroundGravity:設置前景圖像顯示的位置

FrameLayout也沒有什么特別的屬性,就是以上兩個屬性可能會用到,所謂的前景圖像,就是顯示在所有子布局的控件之前顯示。當然這兩個屬性在其他的父布局中也可以使用的,不過可能使用的場景很少。

?著作權歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容