Study Notes for Android-FrameLayout-frame Layout

Source: Internet
Author: User

Development Environment:

Win XP + eclipse-jee-helios (version 3.6) + ADT (version 10.0.1) + Android SDK (version 10 );

Test environment for simulators and real machines: Android2.2


FrameLayout-frame Layout

The frame layout is composed of different components.

<FrameLayout>
<TextView.../> Layer 1
<TextView.../> Layer 2
</FrameLayout>

The second layer can cover one layer. This effect is generally seen on the player, as shown in the following figure:

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/100P4K37-0.png "title =" aa.png "/>

That is, the second layer is deployed on the first layer, and the two la s are superimposed. The following is an example:

1.add the moive.png image of the movie album and play. JPG image of the clicked button to the FrameLayout-> res-> drawable-hdpi folder of the project.

2. In the FrameLayout-> res-> Layout directory of the project, modify the Layout file main. xml to the frame Layout. The Code is as follows:

<?xml version="1.0" encoding="utf-8"?><FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="fill_parent"    android:layout_height="fill_parent"    >    <ImageView        android:layout_width="fill_parent"        android:layout_height="fill_parent"        android:src="@drawable/moive"    />    <ImageView        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:src="@drawable/play"        android:layout_gravity="center"    /></FrameLayout>

Deploy the application on the simulator. The running result is as follows:

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131228/100P43109-1.png "title =" bb.png "/>

Note:ExploitationCtrl + F11You can switch the screen direction of the simulator. In the frame layout, controls are placed in superposition mode, with the upper left corner of the screen as the reference point. In the layout file main. xml, the following controls can be superimposed on the previous controls.

This article from the "Flowers bloom" blog, please be sure to keep this source http://020618.blog.51cto.com/6098149/1293419

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.