Rui Lopes
Rui Lopes

Reputation: 2562

Embossed text in UILabel

I need to draw an effect like this on a UILabel.

Embossed

How can I do it?

Upvotes: 2

Views: 781

Answers (2)

Pradeep Reddy Kypa
Pradeep Reddy Kypa

Reputation: 4022

U can try the below code. U can change the color of the text or the shadow based on the color of the background.

[label setShadowColor:[UIColor darkGrayColor]];

[label setShadowOffset:CGSizeMake(0, -1)];

Upvotes: 1

DrMickeyLauer
DrMickeyLauer

Reputation: 4684

If you're on gray background, I usually just use UILabel's text shadow property positioned one pixel below with color white. That comes quite close. If you really need more (i.e. if you want to have the dark edges above, then you need to write a custom label that draws the text multiple times). CoreGraphics can help you a bit with the CGContextSetShadow, though.

Upvotes: 0

Related Questions