In a UIView inside the "-(void)drawRect:(CGRect)rect" method. I want to draw a plain black line (as a border), but I always get a semi-transparent line. Only the four points at the corners are perfectly black. Why is that?
Here is the mycode:
- (void)drawRect:(CGRect)rect
{
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetAlpha(context,1.0);
CGContextSetRGBStrokeColor(context,0.0,0.0,0.0,1.0);
CGContextMoveToPoint(context,0.0,0.0);
CGContextAddLineToPoint(context,rect.size.width,0.0);
CGContextAddLineToPoint(context,rect.size.width,rect.size.height);
CGContextAddLineToPoint(context,0.0,rect.size.height);
CGContextClosePath(context);
CGContextStrokePath(context);
}