hgpl hgpl - 6 months ago 59
Objective-C Question

Outline for UILabel text

How do I add a black outline to my white UILabel text?


One option is to set the shadow, which might not be exactly what you want, but achieves a similar effect. You can manually adjust the offset:

UILabel *myLabel = ...;
lbl.shadowColor = [UIColor whiteColor];
lbl.shadowOffset = CGSizeMake(0, -1.0);

Please note that you can also define this in Interface Builder for your UILabel.


If this is not enough for you check out this blog post which deals with subclassing UILabel to get a glow effect: