Android View class Introduction-android learning Journey (13)

Source: Internet
Author: User
View Overview

Most Android UI components are placed in the Android.view and Android.widght packages, while Android's UI components inherit the view class.
The view class also has a very important subclass: ViewGroup. ViewGroup inherits view, which is often used as a container for other components, and Android uses the combination mode for view and ViewGroup designs:
That is, ViewGroup belongs to the view class, so viewgroup can contain both the view class and the ViewGroup class.

Introduction to Layouts

Android provides two ways to draw UI components,
1. In the XML file, set the component through the XML attribute.
2. Set component properties in Java code through Java methods.

View common properties and methods introduction

View is the base class for the UI, so his property settings and methods, and other UI components can



ViewGroup Introduction

ViewGroup inherits the view, but it is often used as a container, because it is an abstraction, so it is often used as a container for its subclasses, such as the lattice card layout container.
The ViewGroup control subassembly relies on two two inner classes, Viewgroup.layoutparam and Viewgroup.marginlayoutparam.

Viewgroup.layoutparam the corresponding XML attribute is:

The viewgroup.marginlayoutparam corresponding XML attribute is

Android View class Introduction-android learning Journey (13)

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.