I am trying to add a small red line at the bottom of my UIView.
I want the string to be a 1px string.
Can someone tell me why the following code:
- (void)drawRect:(CGRect)rect { CGContextRef currentContext = UIGraphicsGetCurrentContext(); CGContextSaveGState(currentContext); CGContextSetRGBFillColor(currentContext, 0.0f, 0.0f, 0.0f, 1.0f); CGContextFillRect(currentContext, RECT(0, 0, rect.size.width, rect.size.height - 8)); CGContextSetLineWidth(currentContext, 1); CGContextSetRGBStrokeColor(currentContext, 1.0f, 0.0f, 0.0f, 1.0f); CGContextBeginPath(currentContext); CGContextMoveToPoint(currentContext, 0, rect.size.height - 7); CGContextAddLineToPoint(currentContext, rect.size.width, rect.size.height - 7); CGContextStrokePath(currentContext); CGContextRestoreGState(currentContext); }
Draws a line that is 2px high?
source share