Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make inverted shadow on UILabel?

I'm trying to get an "embed" effect on my UILabel in my app.

Here's what I mean:

alt text

I want it to look like the font is "embedded" or pressed into the background. Please note this font is dynamic, the UILabel will be changed programmatically.

Any ideas as to how this can be done, or as to what font looks like this?

Thanks in advance!

--------------------------------------------------------------------------------------------------------------

Edit: Thanks to fbrunel, I figured out how to do it. Check out the result, though.

alt text

It really doesn't look very nice, any ideas why?

like image 499
sudo rm -rf Avatar asked Dec 22 '22 20:12

sudo rm -rf


1 Answers

It's done using an "inverted" shadow on the text. On UILabel you have two properties to do this: shadowColor and shadowOffset (the direction of the shadow).

label.shadowColor = [UIColor whiteColor];
label.shadowOffset = CGSizeMake(0, 1);

Will do the trick.

like image 88
fbrunel Avatar answered Jan 08 '23 12:01

fbrunel