To encapsulate a view using XIB

Source: Internet
Author: User

1. Create a New XIB file. The internal structure of the view is assumed to be cztgcell. XIB)
2. Create a custom class
(The custom class must inherit the view that comes with the system. The class that inherits the custom class depends on the class of the XIB root object)
3. The class name of the new class should be the same as the file name of the XIB class (for example, the class name is cztgcell)
4. Connect the control in xib with the. M file of the custom class.
5. Provide a class method to return a created custom view (blocking the process of loading from XIB)
6. A model attribute is provided to allow external users to transmit model data.
7. Override the setter method of model attributes. Here, model data is displayed on the corresponding child control.

To encapsulate a view using XIB

Related Article

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.