When the cell is recently displayed, the left side has a 15-pixel offset, and the following method//1 is checked. No use
[Self.tableview Setseparatorinset:uiedgeinsetszero];
2. The effect is not obvious, and the split line cannot be displayed completely from the first pixel
1- (void) TableView: (UITableView *) TableView Willdisplaycell: (UITableViewCell *) cell Forrowatindexpath: (Nsindexpath *) Indexpath {2 if([Self.tableview respondstoselector: @selector (setseparatorinset:)])3 {4 [Self.tableview Setseparatorinset:uiedgeinsetszero];5 }6 if([Self.tableview respondstoselector: @selector (setlayoutmargins:)])7 {8 [Self.tableview Setlayoutmargins:uiedgeinsetszero];9 }Ten}
3. Rewrite the DrawRect method, has the effect, the color setting is convenient, but the operation cell, will increase the mobile phone burden
1- (void) DrawRect: (cgrect) rect {2Cgcontextref context =Uigraphicsgetcurrentcontext ();3 Cgcontextsetfillcolorwithcolor (context, [Uicolor Clearcolor]. Cgcolor);4 cgcontextfillrect (context, rect);5 6 //on split Line7 Cgcontextsetstrokecolorwithcolor (Context,[uicolor Whitecolor]. Cgcolor);8Cgcontextstrokerect (Context,cgrectmake (0,0, Rect.size.width,1));9 Ten //Lower Split Line One Cgcontextsetstrokecolorwithcolor (Context,[uicolor Whitecolor]. Cgcolor); ACgcontextstrokerect (Context,cgrectmake (0, rect.size.height-1, Rect.size.width,1)); -}
4. Customize the cell, hide the cell's separator color, and then add a 1-pixel view to the cell's separator position, set the view color, that is, use the view as a split line, the display works perfectly
UITableViewCell inside the separator set