相关疑难解决方法(0)

如何向UIButton添加投影?

我想为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)

iphone uibutton

75
推荐指数
4
解决办法
8万
查看次数

标签 统计

iphone ×1

uibutton ×1