hgpl hgpl - 1 year ago 136
Objective-C Question

Outline for UILabel text

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

Answer Source

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:


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download