UI of Android interface elements

Source: Internet
Author: User

Android has the following common la s:

1: VIEW component)

In android, The View class is the most basic UI class. Basically, all advanced UI components inherit this class. A View occupies a rectangle area on the screen. It is responsible for rendering this rectangle area. It can also handle events in this rectangle area and set whether the area is visible, and get focus.

2: ViewGroup)

A ViewGroup object is an instance of Android. view. ViewGroup. It is responsible for adding these views to the ViewGroup for layout. Note that a ViewGroup can also be added to another ViewGroup.

3: Layout)

Commonly used layout components include LinearLayout, which can achieve horizontal layout and vertical layout. If the layout direction is set to vertical, it indicates a vertical layout; set to "horizontal" to horizontal layout. In addition, RelativeLayout is relative layout. If A is set to be displayed on the left of B, the coordinate of B is not fixed but relative to A. You can set it through the layout_below attribute.

4: LayoutParams)

When you pass each View to this RelativeLayout, we need to set some parameters of this View (for example, whether the display position is left or right) and encapsulate them in LayoutParams. If the system is not input, the default value is used. If there is a value, it is easy to calculate it based on the passed LayoutParams.

Some common layout descriptions: www.2cto.com

LinearLayout: arranges child elements in one direction. The two directions are horizontal and vertical)

FrameLayout: A blank area is reserved on the screen. All elements are placed at the very top of the FrameLayout area and cannot be given an exact position, if many value elements exist, they overlap with the previous element.

RelativeLayout: relative Layout


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.