UIButton圆角和阴影

2017-01-04  本文已影响208人  只会ctrl_c_v

let bt =UIButton.init(frame:CGRect(x:20, y:250, width:120, height:60))

bt.backgroundColor=UIColor.orange

bt.layer.cornerRadius=10.0

bt.layer.shadowOffset=CGSize(width:1, height:1)

bt.layer.shadowOpacity=0.8

bt.layer.shadowColor=UIColor.green.cgColor

bt.setTitle("搞事情", for: .normal)

self.view.addSubview(bt)

上一篇下一篇

猜你喜欢

热点阅读