Create shadow using QuartzCore for UITextView [duplicate]
问题 This question already has answers here : Why masksToBounds = YES prevents CALayer shadow? (6 answers) Closed 2 years ago . I have created a shadow using QuartzCore for my UITextView with this following code. myTextView.layer.masksToBounds = NO; myTextView.layer.shadowColor = [UIColor blackColor].CGColor; myTextView.layer.shadowOpacity = 0.7f; myTextView.layer.shadowOffset = CGSizeMake(2.0f, 2.0f); myTextView.layer.shadowRadius = 8.0f; myTextView.layer.shouldRasterize = YES; It creates a