Today, when you learn how to achieve the drag effect of ink weather, you see that you are using rewrite framelayout.
Framelayout layouts are the simplest way to layout, and all views added to this layout are displayed in a cascading fashion. The first view in the layout is displayed at the bottom, and the last one is placed at the top level. The view on the previous layer overrides the next layer of view, so the layout is similar to the stack layout . Note the point: A. The default is to align it in the upper-left corner. B. To set the location of the child view, set the Layout_gravity property value.
1<?xml version= "1.0" encoding= "Utf-8"?>2<Framelayout3Xmlns:android= "Http://schemas.android.com/apk/res/android"4Android:layout_width= "Fill_parent"5android:layout_height= "Fill_parent"6Android:background= "#897753"7>8<ImageView9Android:id= "@+id/image1"TenAndroid:layout_width= "Fill_parent" Oneandroid:layout_height= "Fill_parent" Aandroid:visibility= "Invisible" -android:src= "@drawable/sky"/> -<ImageView theAndroid:id= "@+id/image2" -android:visibility= "Invisible" -Android:layout_width= "Fill_parent" -android:layout_height= "Fill_parent" +android:src= "@drawable/cloud"/> -<ImageView +Android:id= "@+id/image3" Aandroid:visibility= "Invisible" atAndroid:layout_width= "Fill_parent" -android:layout_height= "Fill_parent" -android:src= "@drawable/sun"/> - -</FrameLayout>
Among them, Image1, Image2, Image3 are all in the same space. It can be said that they overlap, the interface shows the most recent use of the one.
Framelayout Summary in Android