. Net programmers play Android Development --- (10) frame layout FrameLayout and androidframelayout
All the controls in the frame layout FrameLayout are on the top left of the interface. The space drawn after the frame layout overwrites the previous controls. The controls in the layout are displayed in layers, which may be used in game development.
1. Stacked display in the following example, three textviews are displayed in stacked mode, and the stacked mode of these three controls is displayed in size and color.
<? 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_width = "300dp" android: layout_height = "300dp" android: text = "Youxiang cloud stop Studio" android: gravity = "center" android: background = "# FFE4B5"/> <TextView android: id = "@ + id/textView1" android: layout_width = "150dp" android: layout_height = "120dp" android: text = "Youxiang cloud stop Studio" android: gravity = "center" android: background = "# D1EEEE"/> <TextView android: layout_width = "100dp" android: layout_height = "50dp" android: text = "Youxiang cloud stop Studio" android: gravity = "center" android: background = "# EEB422"/> </FrameLayout>
2. Product List Example
<? 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"> <ImageView android: id = "@ + id/imageView1" android: layout_width = "100dp" android: layout_height = "100dp" android: src = "@ raw/pad"/> <TextView android: layout_width = "wrap_content" android: layout_height = "wrap_content" android: text = "Product Name: Ipad Air" android: layout_marginLeft = "120dp" android: layout_marginTop = "10dp"/> <TextView android: layout_width = "wrap_content" android: layout_height = "wrap_content" android: text = "item Amount: $20" android: layout_marginLeft = "120dp" android: layout_marginTop = "40dp"/> <TextView android: layout_width = "wrap_content" android: layout_height = "wrap_content" android: text = "color: White" android: layout_marginLeft = "120dp" android: layout_marginTop = "70dp"/> <TextView android: layout_width = "fill_parent" android: layout_height = "3dp" android: text = "" android: layout_marginLeft = "0dp" android: layout_marginTop = "110dp" android: background = "# D1EEEE"/> <ImageView android: id = "@ + id/imageView2" android: layout_width = "100dp" android: layout_height = "100dp" android: layout_marginTop = "120dp" android: src = "@ raw/pad"/> <TextView android: layout_width = "wrap_content" android: layout_height = "wrap_content" android: text = "Product Name: Ipad Air" android: layout_marginLeft = "120dp" android: layout_marginTop = "140dp"/> <TextView android: layout_width = "wrap_content" android: layout_height = "wrap_content" android: text = "item Amount: $20" android: layout_marginLeft = "120dp" android: layout_marginTop = "170dp"/> <TextView android: layout_width = "wrap_content" android: layout_height = "wrap_content" android: text = "product color: white "android: layout_marginLeft =" 120dp "android: layout_marginTop =" 200dp "/> <TextView android: layout_width =" fill_parent "android: layout_height =" 3dp "android: text = "" android: layout_marginLeft = "0dp" android: layout_marginTop = "220dp" android: background = "# D1EEEE"/> </FrameLayout>
Zookeeper