Ben Gottlieb
2009-11-07 22:10:40
Wow. Awesome. Ben, luvieere's right. His way is easier! ;)
Jordan
2009-11-07 22:43:29
ah, yes, cornerRadius is cool, but, as he noted, 3.0 only. This is slightly older code.
Ben Gottlieb
2009-11-08 00:35:42
Ben, I can't think of any reason why anyone (even Jailbreakers) would elect to stay on iPhone OS v2.2.1 or prior versions. Can you?
Jordan
2009-11-10 12:13:58
+3
A:
Wow... aaa... ok... I've got an easier way:
#import <QuartzCore/QuartzCore.h>
.....
UILabel *label = [[UILabel alloc] initWithFrame:
CGRectMake(cell.contentView.frame.size.width - 50, 0, 35, 35)];
label.layer.cornerRadius = 5;
label.backgroundColor = [UIColor blueColor]; //feel free to be creative
label.clipToBounds = YES;
label.text = @"7"; //Your text here
[cell.contentView addSubview: label];
[label release];
Basically, you're making a UILabel with rounded corners using the QuartzCore framework - don't forget to include it. Extra note: it only works on OS > 3.0.
luvieere
2009-11-07 22:19:33