. Net programmers play Android Development --- (10) frame layout FrameLayout and androidframelayout

Source: Internet
Author: User

. 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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.