A few questions about TableView solution integration

Source: Internet
Author: User

Recently encountered the integration of tableview issues. Part of the comparison idiot, just beginner easy to commit ~

1, about TableView left free 15 pixels of the problem;
2, about the TableView redundant division line hidden problems;
3, about the tableview of the Headercell between the space between the question;
4. Questions about Select and deselect.

1, about TableView left free 15 pixels of the problem

There's always a place on the left.
Workaround:
Calling the Leftline method is fine-The following method does not need to be called, is the Protocol method

-(void) _leftline {if([_moretableview respondstoselector: @selector (SetSeparatorinset:)]) {[_moretableviewSetSeparatorinset:uiedgeinsetszero]; }if([_moretableview respondstoselector: @selector (SetLayoutmargins:)]) {[_moretableviewSetLayoutmargins:uiedgeinsetszero]; }}-(void) TableView: (UITableView *) TableView Willdisplaycell: (UITableViewCell *) cell forRowatindexpath: (Nsindexpath *) indexpath{if([Cell Respondstoselector: @selector (SetSeparatorinset:)]) {[cellSetSeparatorinset:uiedgeinsetszero]; }if([Cell Respondstoselector: @selector (SetLayoutmargins:)]) {[cellSetLayoutmargins:uiedgeinsetszero]; }

2, about the TableView redundant split line hidden problem
Sometimes the cell below is useless, but there is a split line, hiding the way

    [tableView setTableFooterView:[[UIView alloc] init]];

There are a lot of ways, but it seems to me the simplest ~

3, about the TableView Headercell between the space between the question
What we want is this:

But it's possible to get this:

This is due to the TableView style setting error, the former is Uitableviewstyleplain, and the latter is uitableviewstylegrouped

To pay attention to the style of understanding, not tableview have a lot of sections to choose uitableviewstylegrouped,uitableviewstylegrouped just show TableView a style, There are several unrelated to the section

4. Questions about Select and deselect
This question is pure cruel ~
Select and deselect, the function is very long, careful and careful again carefully, otherwise, if the error, adjust the bug is this error really will be very hard ~

Above the first two methods from other people's blog ~

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

A few questions about TableView solution integration

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.