(IOS)UITextView中的文字添加阴影效果

- (void)setTextLayer:(UITextView*)textView color:(UIColor*)color

{

    CALayer*textLayer = ((CALayer*)[textView.layer.sublayersobjectAtIndex:0]);

    textLayer.shadowColor= color.CGColor;

    textLayer.shadowOffset=CGSizeMake(0.0f,1.0f);

    textLayer.shadowOpacity=1.0f;

    textLayer.shadowRadius=1.0f;

}

你可能感兴趣的:((IOS)UITextView中的文字添加阴影效果)