开发者

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:

How to make inverted shadow on UILabel?

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.

How to make inverted shadow on UILabel?

It really开发者_如何学编程 doesn't look very nice, any ideas why?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜