I have a UIView that draws a circle from inside drawRect:rect. After reading the Apple dev info on the Retina display, it seemed like using Core Graphics meant that the drawings would automatically take advantage of the higher res. This simple circle, however, looks pretty chunky as compared to a similar circle in a badge icon. Obviously I'm comparing it to something that has gloss and shadow but I think it's pretty obvious that mine is not being drawn as well. I tried taking screenshots of apple's icon badge and my circle and they look about the same on my mac - the difference is obvious when looking at each on the phone, though. Is there something simple I'm missing here?
This is the drawing code that I'm using in drawRect:rect
UIBezierPath* aPath = [UIBezierPath bezierPathWithOvalInRect:
CGRectMake(0, 0, 22, 22)];
[[UIColor whiteColor] setStroke];
[[UIColor redColor] setFill];
CGContextRef aRef = UIGraphicsGetCurrentContext();
CGContextTranslateCTM(aRef, 10, 10);
aPath.lineWidth = 3;
[aPath fill];
[aPath stroke];
Thanks for any help, Rob
Oops, it needed antialiasing first:
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetShouldAntialias(context, YES);
I added this before drawing, then set it to NO and drew another circle immediately afterward. The two circles, side by side, show that this was the problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With