ANDROID View Structure

Source: Internet
Author: User

First, Introduction

Android, in order to interact with the device's screen, requires the use of two core Java classes. They are the most commonly used and most important two classes in Android development:

    • View class
    • ViewGroup class

View and ViewGroup are the core upper classes, which, like all Java classes, derive from the Java object class. View objects can be created using the view class, which can also be used to create many or more lower-level, or more specific, Java classes that are derived from the view class and inherit all the attributes of their superclass.

Second, view class

The entire displayed screen can consist of one or more view objects, depending on how the view class and the ViewGroup class are used to create UI artifacts for the screen of an Android application. Here's a look at what controllable properties the view class provides for Android opener:

    • Boundary (size)
    • The layout on the screen
    • Layer Display Order
    • Rolling
    • Focus
    • Key interaction
    • Gesture interaction

The View object has the ability to receive events, that is, to receive interactive events from the application user and the View object. Therefore, the view class is a Java component that can be derived to construct more detailed and specific UI elements, such as: Buttons, checkboxes, single-line buttons, and text boxes.

Three, nested views: ViewGroup class

ViewGroup is a subclass of view derivation that is used to derive a layout container class that groups and organizes the view objects on the screen in an orderly manner.

ViewGroup is a layout container, which is typically a collection of UI elements that can be buttons, text boxes, check boxes, and so on. That is, the UI element can be of any type (including a custom new control derived from the view class).

(This image comes from an introduction to Android app development)

ViewGroup derived subclasses are: Absolutelayout, Relativelayout, Framelayout, LinearLayout, and Drawlayout. About, these types of layouts are described in detail: http://www.cnblogs.com/naray/p/5274964.html

ANDROID View Structure

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.