Android--inflate

Source: Internet
Author: User
Inflate

To customize a view in your app to get the layout of this view, you need to use the following method,

null);

The second parameter in the general data is a null. Normally there is no problem, but if I want to set a corresponding class for this view and then use this class to manipulate it, there will be problems.

this);

You can see that in inflate (Xmlpullparser parser, ViewGroup root, Boolean attachtoroot) functions, only the root is not equal to NULL to actually add the view to the ListView.

The meaning of the root of the parameter: @param root Optional view to be the parent of the generated hierarchy

This means that this is what the View container is . If you don't tell the SDK where you want to put the view, you can't create a view.

Android--inflate

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.