Framelayout Summary in Android

Source: Internet
Author: User

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

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.