[Ios]swift UITableView added Headerview pit-daddy problem created by Xib

Source: Internet
Author: User

The situation is like this, I UITableView added a headerview, this headerview is created through Xib, is UIView. Out of the results unexpectedly, UITableView cell the top of a few are headerview to obscure ~ ~ ~ I le a go ~ ~ God horse situation?

So brother by looking at the hierarchy structure, found to run out of the Headerview and cell list is not the same level, it should be the same layer is right!!!! So I tried the other xib, the same thing, and then instead use code to create UIView () like this way, so that's normal, headerview and cell lists are all the same level.

But Headerview content and more complex, write in code and layout is too laborious, continue to find solutions ... So the wit I use cell a try, cell of Xib way as Headerview magical normal.

Yes, that's it, this xib must be UITableViewCell, and then

Tableview.tableheaderview = Nsbundle.mainbundle (). loadnibnamed ("Moviedatedetailed_headercellview  ", Owner:nil, options:nil) [0 as this UITableViewCell

This will be OK ~ ~ ~

[Ios]swift UITableView added Headerview pit-daddy problem created by Xib

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.