Android User Interface Design: Layout BASICS (1)

Source: Internet
Author: User

Understanding the layout is very important for a good Android Application Design. In this tutorial, we provide an overview of how to adapt the layout to the Android application architecture. We also explored some specific available layout controls that can be used to organize application screen content in various ways.

What is layout?

Android Developers use the term "layout", which refers to one of the two meanings. The two definitions are used in this tutorial, and unfortunately they are mixed in the Android development community. Two la s are defined as follows:

A resource that defines what to draw on the screen. Layout resources are stored in the XML file under the/res/layout Resource Directory of the application. A Layout resource is simply a template used for a user interface screen, a part of the screen, and content.

A View class that organizes other controls. These layout classes include LinearLayout, RelativeLayout, and TableLayout. They are used to display child controls, such as text controls, buttons, and images on the screen.

The Android user interface can be defined as a dynamic creation of layout resources or programs in XML.

Use Eclipse to design and layout Resources

The Android development plug-in of Eclipse contains a convenient layout Resource Designer for designing and previewing layout resources. This tool includes two tag views: the layout view allows you to preview the display of controls on different screens and in each direction. The XML view tells you the XML definition of the resource. The layout Resource Designer is as follows:

Here are some tips for using the layout resource editor in Eclipse:

◆ Use the overview Outline) pane to add and delete controls in your layout resources.

◆ Select a specific control in the preview or summary window) and use the properties pane to adjust the properties of a specific control.

◆ Use XML tags to directly edit XML definitions.

It is important to remember that the Eclipse layout resource editor cannot accurately simulate the presentation of the layout on the end user. To do this, you must test it in a properly configured simulator, and more importantly, test it on the target device. Some "complex" controls, including tags or video viewers, cannot be previewed in Eclipse.


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.