iOS set up Split line start from top of border

Source: Internet
Author: User

Good method, originally in the Xib set custom split line position, the result is still 15 pixels, the method pro-Test. IOS8 set TableView Separatorinset Split line start from the top of the border (go)On the iOS8 [TableViewSetseparatorinset:Uiedgeinsetsmake(0,0,0,0)]; not working

The following methods have been tested to work correctly on iOS7 8
-(void) Viewdidlayoutsubviews {if([Self.tableview respondstoselector: @selector (setseparatorinset:)]) {[Self.tableview Setseparatorinset: Uiedgeinsetsmake (0,0,0,0)]; }                    if([Self.tableview respondstoselector: @selector (setlayoutmargins:)]) {[Self.tableview setlayoutmargins:u Iedgeinsetsmake (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]; }      }  


/span>

For extra dashes, a horizontal line appears if you don't see the full screen.

Only need to be set to

uitableviewstylegrouped

iOS set up Split line start from top of border

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.