Created
November 14, 2012 08:20
-
-
Save kaiix/4070967 to your computer and use it in GitHub Desktop.
Revisions
-
kaiix created this gist
Nov 14, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,38 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; // Configure the cell... if (!cell) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; } // style cell.textLabel.textColor = [UIColor colorWithRed:65.0/255.0 green:131.0/255.0 blue:196.0/255.0 alpha:1.0]; cell.textLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:16]; CAShapeLayer *shapelayer = [CAShapeLayer layer]; UIBezierPath *path = [UIBezierPath bezierPath]; //draw a line [path moveToPoint:CGPointMake(0.0, cell.frame.size.height)]; //add yourStartPoint here [path addLineToPoint:CGPointMake(cell.frame.size.width, cell.frame.size.height)];// add yourEndPoint here UIColor *fill = [UIColor colorWithRed:0.80f green:0.80f blue:0.80f alpha:1.00f]; shapelayer.strokeStart = 0.0; shapelayer.strokeColor = fill.CGColor; shapelayer.lineWidth = 1.0; shapelayer.lineJoin = kCALineJoinRound; shapelayer.lineDashPattern = [NSArray arrayWithObjects:[NSNumber numberWithInt:1],[NSNumber numberWithInt:3 ], nil]; // shapelayer.lineDashPhase = 3.0f; shapelayer.path = path.CGPath; [cell.contentView.layer addSublayer:shapelayer]; // set content cell.textLabel.text = [self getContentForRow:indexPath.row]; return cell; }