Frame layout (frame layout) is the simplest form of layout. All views added to this layout are displayed in a cascading fashion. The first added control is placed at the bottom, and the last view added to the frame layout is displayed at the top level, and the previous control overrides the next layer of control. This display is somewhat similar to a stack.
Sample code
<?XML version= "1.0" encoding= "Utf-8"?><Framelayoutxmlns:android= "Http://schemas.android.com/apk/res/android"Android:layout_width= "Match_parent"Android:layout_height= "Match_parent"> <Framelayoutxmlns:android= "Http://schemas.android.com/apk/res/android"Android:layout_width= "Match_parent"Android:layout_height= "Match_parent"> <TextViewAndroid:layout_width= "200DP"Android:layout_height= "200DP"Android:background= "#FF6143" /> <TextViewAndroid:layout_width= "150DP"Android:layout_height= "150DP"Android:background= "#7BFE00" /> <TextViewAndroid:layout_width= "100DP"Android:layout_height= "100DP"Android:background= "#FFFF00" /> </Framelayout> <Framelayoutxmlns:android= "Http://schemas.android.com/apk/res/android"Android:layout_width= "Fill_parent"Android:layout_height= "Fill_parent"> <TextViewAndroid:id= "@+id/textview1"Android:layout_width= "140DP"Android:layout_height= "140DP"android:layout_gravity= "Center"Android:background= "#FF33ffff" /> <TextViewAndroid:id= "@+id/textview2"Android:layout_width= "80DP"Android:layout_height= "80DP"android:layout_gravity= "Center"Android:background= "#FF33ccff" /> <TextViewAndroid:id= "@+id/textview3"Android:layout_width= "20DP"Android:layout_height= "20DP"android:layout_gravity= "Center"Android:background= "#FF3399ff" /> </Framelayout></Framelayout>
Android Layout Framelayout