我想为UIButton添加一个投影.我试图使用self.layer.shadow*属性.这些属性在UIView中有效,但它们在UIButton中的表现不同.如果我能得到任何指针来绘制投影,我将非常感激.谢谢!
self.layer.cornerRadius = 8.0f;
self.layer.masksToBounds = YES;
self.layer.borderWidth = 1.0f;
self.layer.shadowColor = [UIColor greenColor].CGColor;
self.layer.shadowOpacity = 0.8;
self.layer.shadowRadius = 12;
self.layer.shadowOffset = CGSizeMake(12.0f, 12.0f);
Run Code Online (Sandbox Code Playgroud)