The method of setting the full screen divider of uitableview in the development of IOS program (without drawing lines) _ios

Source: Internet
Author: User

Ableview is a commonly used control in app development and is powerful for data display. Here are two ways to set up a full screen divider for UITableView.

The specific details are as follows:

Add the following code as shown

Stableview.separatorinset = Uiedgeinsetszero;
Stableview.layoutmargins = Uiedgeinsetszero;
Cell.layoutmargins = Uiedgeinsetszero;

The second method is shown below

-(void) viewdidlayoutsubviews
{
[super viewdidlayoutsubviews];
if ([_moretableview respondstoselector: @selector (setseparatorinset:)]) {
[_moretableview setseparatorinset: Uiedgeinsetsmake (0,0,0,0)];
}
if ([_moretableview respondstoselector: @selector (setlayoutmargins:)]) {
[_moretableview setlayoutmargins: Uiedgeinsetsmake (0,0,0,0)];
}
-(void) TableView: (UITableView *) TableView Willdisplaycell: (UITableViewCell *) cell Forrowatindexpath: (NSIndexPath *) Indexpath
{
If [cell Respondstoselector: @selector (setseparatorinset:)]) {
[cell Setseparatorinset: Uiedgeinsetszero];
}
if ([Cell respondstoselector: @selector (setlayoutmargins:)]) {
[cell Setlayoutmargins:uiedgeinsetszero];
}
}

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.