UITableView Customization and adaptive height

Source: Internet
Author: User

1. The first step in customizing the cell , declare all the child view controls to be displayed by the cell as attributes (not the same name as The property inside the cell )

2. Rewrite cell initialization method frame given as 0 adds the control to the cell above the display. One to be aware of using Self.contarntview to add

3. override The Layoutsubviews method, given the exact location of the internal control

4. Import the model, bind the model to the cell , declare the model's properties

5. override the setter method of the model property. Internal use model assigns values to internal controls

The method of adaptive height

Find the height of a text display

+ (cgfloat) heightforstring: (nsstring *) string;

Returns the height of the cell

+ (cgfloat) cellheightforstudent: (Student *) Student;

UITableView Customization and adaptive height

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.