text with sharp shadow around
I want to achieve the text appearance like in the pictures below:
Now I'm working on shadow around the letters and I can't figure out how to
do that.
What I've tried so far:
- The solution with:
label.shadowColor = [UIColor blackColor];
label.shadowOffset = CGSizeMake(1, 2);
gives a nice sharp shadow, but it doesn't fit to my needs by two reasons:
It gives a shadow only from one side, set up by shadowOffset, whereas I
need a "wrapping" shadow;
This solution doesn't give the soft part of the shadow (gradient) as there
is in the pictures;
-The solution with:
label.layer.shadowOffset = CGSizeMake(0, 0);
label.layer.shadowRadius = 5.0;
label.layer.shouldRasterize = YES;
label.layer.shadowOpacity = 1;
label.layer.shadowColor = [UIColor blackColor].CGColor;
label.layer.masksToBounds = NO;
Works great, but it gives too soft shadow even though the shadowOpacity is
set to 1 and the shadowColor is set to black:
Obviously it's not enough and I already think about drawing in labels'
context. But it is not clear to me how would I achieve the goal even
through context drawing.
Any idea would be much appreciated.
No comments:
Post a Comment