Basic knowledge of Android interface Layout

Source: Internet
Author: User

The Android mobile phone operating system is compiled in the simulator to help us implement various functional requirements. Especially in the interface operations. Here, we can have an in-depth understanding of the Android interface layout operations.

  • Android Timer Programming Method
  • Android ListActivity full solution
  • Android SDK
  • Android power management related application skills
  • Introduction to how to create an Android NDK Environment

I have been developing the iphone for the past. Now I want to add my interest to my work and turn it into Android development. Here, I want to learn about Android, so that I can find it somewhere in the future.

The interface is the most basic for applications, So I first studied how to create the Androidi interface. I thought it was very simple, just like other iphone and vc, the interface is the WYSIWYG mode. Later I saw that this was not the case .....
The andorid interface needs to be written in the xml of res/layout. Generally, the xml corresponds to an interface.

The layout of the Android interface is a bit like html (the method for writing comments code is the same). You must first set the Android framework and then place controls in the framework. Android provides several frameworks, AbsoluteLayout, linearLayout, RelativeLayout, TableLayout, FrameLayout

FrameLayout: there is only one control in it, and the position of the control cannot be designed. The control is placed in the upper left corner.

LinearLayout: Multiple controls can be placed, but only one control can be placed in one row.

TableLayout: this should be used with TableRow, much like the table in html

AbsoluteLayout

RelativeLayout: Multiple controls can be placed in the control, but the control positions are relative positions.

(The layout of the Android interface seems to be able to directly reference some views, such as ScrollView)

The xml of the Framework is as follows:

 
 
  1. Android:id="@+id/widget36"   
  2. Android:layout_width="fill_parent"   
  3. Android:layout_height="fill_parent"   

The above code starts with Android:, indicating the control property. fill_parent is the system's built-in parameter, indicating the maximum width or height. There is also a wrap_content, indicating the right width or height. In addition to the preceding three attributes, there are also some other attributes, such as Android: background = "# FF0000FF", which sets the background color of the framework, androidrientation = "vertical" is used to set the trend attributes in this framework.

The above is an introduction to the concept of Android interface layout.

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.