Android Learning History-screen element hierarchy (View,viewgroup)

Source: Internet
Author: User

These days of study, often see View,viewgroup, and what Layoutinflater, and then look back at the original learned things.

Screen element hierarchyAndroid App Basic functional unit is activity-android.app.activity, an Activity can be a lot of things, but it does not exist on the screen itself. In order for your activity to have a screen display and be able to design her UI, you have to use the basic unit of the user interface expression on the views and viewgroups-android platform. Views

A view is an object in the base class Android.view.View. She is a data structure with properties that store content within a particular rectangular area of the layout and screen.

A view object that can handle measurements and layouts (I want to be the location of the layout to determine the meaning of it), draw, focus changes, scrolling, and on-screen gesture manipulation.

The view class is the base class for widgets-a complete set of well-implemented subclasses can draw the elements needed for screen interaction. Those Widgets (controls) handle their own measurements and drawings, so you can build your own UI more quickly. The available widgets include: Text,edittext,inputmethod,movementmethod,button,radiobutton ...

ViewGroup

A viewgroup is an object in the class Android.view.ViewGroup. As its name suggests, a viewgroup is a special type of view object, and her function is to include and manage the views and other viewgroups,viewgruop of its attribution to allow your UI to add structs (my understanding is nested ViewGroup), Create complex screen elements (that is, the view lot),

ViewGroup as the base class for layout-is also a complete set of well-implemented subclasses, providing a common type of screen layout. The layout is provided to you, and then you use the previous set of views to build your view structure.

A tree-structured UI

  

Layoutparams:how A child specifies its POSITIOB and Size

Each ViewGroup class has an inner class that inherits Viewgroup.layoutparams.

Recommended links, said can also: http://byandby.iteye.com/blog/816718

Android Learning History-screen element hierarchy (View,viewgroup)

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.