Actually I love UILabel
. They\'re sweet. Now I had to go to UITextView
because UILabel
is not aligning text vertically to the top. Damn. O
The answer with
text.layer.shadowColor
adds shadow to whole textView, perhaps it works, but it adds shadow not only to text.
The correct answer is:
CALayer *textLayer = ((CALayer *)[textView.layer.sublayers objectAtIndex:0]);
textLayer.shadowColor = [UIColor whiteColor].CGColor;
textLayer.shadowOffset = CGSizeMake(0.0f, 1.0f);
textLayer.shadowOpacity = 1.0f;
textLayer.shadowRadius = 1.0f;