btn.layer.shadowOpacity = 0.8 //阴影区域透明度 btn.layer.shadowColor = UIColor.black.cgColor // 阴影区域颜色 btn.layer.shadowOffset = CGSize(width: 1, height: 1) //阴影区域范围
转载于:https://www.cnblogs.com/kunH/p/7269269.html