TableView Common Tips

Source: Internet
Author: User

Split Line Shelf iOS8 UITableView Split Line shelf approach
IOS8 cell Split Line shelf if ([_tableview respondstoselector: @selector (setseparatorinset:)]) {    [_tableview Setseparatorinset:uiedgeinsetszero];} if ([_tableview respondstoselector: @selector (setlayoutmargins:)]) {    [_tableview setlayoutmargins: Uiedgeinsetszero];} IOS8 Cell Split Line shelf-(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];}    }
Clear extra cell split lines (cell is rare)
_tableview.tablefooterview=[[uiview alloc]init];//Clear redundant splitter lines

Turn off UITableViewCell's selected effect

Cell.selectionstyle = uitableviewcellselectionstylenone;//Colorless

Uncheck State

-(void) TableView: (UITableView *) TableView Didselectrowatindexpath: (Nsindexpath *) indexpath{    [TableView Deselectrowatindexpath:indexpath animated:yes];//Uncheck Status}

Custom UITableViewCell Background When selected
Cell.selectedbackgroundview = [[Uiimageview alloc] initwithimage:[uiimage imagenamed:@ "Cellart.png"]];// Font Color Cell.textLabel.highlightedTextColor = [Uicolor Orangecolor]; [Cell.textlabel settextcolor:orangecolor];//sets the color of the cell's font

TableView Common Tips

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: 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.