views:

252

answers:

3

Hi!

Is there an API that will let me reproduce the blue round email address bubbles easily? You see these bubbles in Mail on MacOS and on the iPhone.

Thanks!

+5  A: 

Yes. Use the NSTokenField class.

outis
Don't think this is available on the iPhone.
Ramin
You're right, looks like it isn't available for the iPhone. =(
Hua-Ying
see my response on how to do this on the iPhone
Felix
+4  A: 

Might want to take a look at Numeric badges on the iPhone.

Another alternative is the Three20 project. Its samples shows a method for compositing 'badges.'

Ramin
Thanks, those alternatives look nice!
Hua-Ying
+6  A: 

To get a rounded label simply include the QuartzCore-Framework in your project and add this to your .m file:

#import <QuartzCore/QuartzCore.h>

Then create a regular UILabel *label. Set the font, textColor, backgroundColor as you like and then add rounded Corners:

label.layer.cornerRadius = label.frame.size.height/2;
Felix
I used this method - works great!
Adam Eberbach
You can also add a border by setting the borderWidth and borderColor.
Felix