The frame layout is represented by Framelayout, and Framelayout directly inherits the Viewgoup component.
The Frame layout container creates a blank area (called a frame) for each component that is added to it, and each subassembly occupies one frame, and the frames are automatically aligned according to the Gravity property.
Code:
<?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 "android:orientation=" vertical " > <!--define 6 TextView in turn, the first defined TextView is located on the lower level TextView is located on the upper--><textview android:id= "@+id/view01" an Droid:layout_width= "Wrap_content" android:layout_height= "wrap_content" android:layout_gravity= "center" Android:wi Dth= "320px" android:height= "320px" android:background= "#f00"/><textview android:layout_width= "Wrap_con Tent "android:layout_height=" wrap_content "android:layout_gravity=" center "android:width=" 280px "Android:heigh t= "280px" android:background= "#0f0"/><textview android:layout_width= "Wrap_content" Android:layout_heig ht= "wrap_content" android:layout_gravity= "center" android:width= "240px" android:height= "240px" Android:backgro Und= "#00f"/><textviewAndroid:layout_width= "Wrap_content" android:layout_height= "wrap_content" android:layout_gravity= "Center" android: Width= "200px" android:height= "200px" android:background= "#ff0"/><textview android:layout_width= "Wrap_c Ontent "android:layout_height=" wrap_content "android:layout_gravity=" center "android:width=" 160px "Android:hei ght= "160px" android:background= "#f0f"/><textview android:layout_width= "Wrap_content" android:layout_he ight= "wrap_content" android:layout_gravity= "center" android:width= "120px" android:height= "120px" android:backg Round= "#0ff"/></framelayout>
Effect:
Framelayout Frame layout in Android