Set the fillet setting for the TableView overall
Set rounded corners
V_tableview.layer.cornerRadius = 7;
V_tableview.layer.masksToBounds = YES;
Set border
V_tableview.layer.borderWidth = 1;
V_tableview.layer.borderColor = [COLOR (189, 189, 189, 1) Cgcolor];
IOS7 settings for each set of rounded corners after grouping
#pragma mark-table View data source
-(void) TableView: (UITableView *) TableView Willdisplaycell: (UITableViewCell *) cell Forrowatindexpath: (Nsindexpath *) indexpath{
//
if ([Cell respondstoselector: @selector (Tintcolor)]) {
if (TableView = = V_tableview) {
//
CGFloat Cornerradius = 10.f;
Cell.backgroundcolor = Uicolor.clearcolor;
Cashapelayer *layer = [[Cashapelayer alloc] init];
Cgmutablepathref pathref = cgpathcreatemutable ();
CGRect bounds = cgrectinset (cell.bounds, 0, 0);
//
BOOL addline = NO;
Draw rounded Corners
if (Indexpath.row = = 0 && Indexpath.row = = [TableView numberofrowsinsection:indexpath.section]-1) {
//
Cgpathaddroundedrect (pathref, nil, bounds, Cornerradius, Cornerradius);
//
} else if (Indexpath.row = = 0) {
//
Cgpathmovetopoint (Pathref, Nil, cgrectgetminx (bounds), cgrectgetmaxy (bounds));
//
Cgpathaddarctopoint (Pathref, Nil, cgrectgetminx (bounds), cgrectgetminy (bounds), cgrectgetmidx (bounds), C Grectgetminy (bounds), Cornerradius);
//
Cgpathaddarctopoint (Pathref, Nil, cgrectgetmaxx (bounds), cgrectgetminy (bounds), Cgrectgetmaxx (bounds), C Grectgetmidy (bounds), Cornerradius);
//
Cgpathaddlinetopoint (Pathref, Nil, cgrectgetmaxx (bounds), cgrectgetmaxy (bounds));
//
AddLine = YES;
//
} else if (Indexpath.row = = [TableView numberofrowsinsection:indexpath.section]-1) {
//
Cgpathmovetopoint (Pathref, Nil, cgrectgetminx (bounds), cgrectgetminy (bounds));
//
Cgpathaddarctopoint (Pathref, Nil, cgrectgetminx (bounds), cgrectgetmaxy (bounds), cgrectgetmidx (bounds), C Grectgetmaxy (bounds), Cornerradius);
//
Cgpathaddarctopoint (Pathref, Nil, cgrectgetmaxx (bounds), cgrectgetmaxy (bounds), Cgrectgetmaxx (bounds), C Grectgetmidy (bounds), Cornerradius);
//
Cgpathaddlinetopoint (Pathref, Nil, cgrectgetmaxx (bounds), cgrectgetminy (bounds));
//
} else {
//
Cgpathaddrect (pathref, nil, bounds);
//
AddLine = YES;
//
// }
//
Layer.path = Pathref;
//
Cfrelease (PATHREF);
//
Layer.fillcolor = [Uicolor colorwithwhite:1.f alpha:0.8f]. Cgcolor;
//
//
//
if (AddLine = = YES) {
//
Calayer *linelayer = [[Calayer alloc] init];
//
CGFloat lineheight = (1.F/[UIScreen Mainscreen].scale);
//
Linelayer.frame = CGRectMake (Cgrectgetminx (bounds) +10, Bounds.size.height-lineheight, bounds.size.width- Ten, lineheight);
//
Linelayer.backgroundcolor = TableView.separatorColor.CGColor;
//
[Layer Addsublayer:linelayer];
//
// }
//
UIView *testview = [[UIView alloc] initwithframe:bounds];
[Testview.layer Insertsublayer:layer atindex:0];
Testview.backgroundcolor = Uicolor.clearcolor;
Cell.backgroundview = TestView;
//
// }
//
// }
//
//}
TableView the selected color settings
- //Colorless
- Cell.selectionstyle = Uitableviewcellselectionstylenone;
- //Blue
- Cell.selectionstyle = Uitableviewcellselectionstyleblue;
- //Grey
- cell.selection style = uitableviewcellselectionstylegray;