我在 Stack Overflow 上搜索了苹果的文档和其他帖子,但我仍然无法在 UITextView 内部添加阴影。我想让它看起来像一个 UITextField。这是我尝试过的代码。
CALayer *frontLayer = self.frontField.layer;
[frontLayer setBorderColor:CGColorCreate(CGColorSpaceCreateDeviceGray(), nil)];
[frontLayer setBorderWidth:1];
[frontLayer setCornerRadius:5];
[frontLayer setShadowRadius:10.0];
CGSize shadowOffset = {0.0,3.0};
[frontLayer setShadowOffset:shadowOffset];
[frontLayer setShadowOpacity:1];
self.frontField.clipsToBounds = YES;
我哪里错了?