Folding table ideas and problems encountered (Tableview:viewforheaderinsection: section starting from 1, not starting from 0)

Source: Internet
Author: User

Project needs to make a similar QQ contact folding table, the idea is simple: Set the header of each section, display the group name on the header, and then according to the collapse or not, set the number of cells in each section, if collapsed, set it to 0, Otherwise set to the actual number of cells, then refresh the table.

So here's the question:

1. If you use a Uitableviewstyleplain-style table, the header will hover over the top when the table slides, rather than sliding along the table.

2. If a uitableviewstylegrouped style table is used, the Tableview:viewforheaderinsection: The section value starts at 1 instead of 0

Solution:

Issue 1: Set the style of the table to uitableviewstylegrouped so that the header slides with the table and does not hover over the top. However, the style will change, because the uitableviewstylegrouped table will have the default header and footer height (as if it is 13), according to their own needs, the corresponding header and footer can be set.

Issue 2: The reason for this is that it should be a bug to set the header height using sectionheaderheight instead of using the delegate method (Tableview:heightforheaderinsection:).

Folding table ideas and problems encountered (Tableview:viewforheaderinsection: section starting from 1, not starting from 0)

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.