由 CyanHall.com
创建于 2020-12-22,
上次更新:2021-03-30。
👉 如果有用请点赞。 参考:
UIView with rounded corners and drop shadow?
👉 如果有用请点赞。
//
// SDShadowView.swift
// Created by Cyanhall.com on 21/12/2020.
//
import UIKit
class SDShadowView: UIView {
override init(frame: CGRect) {
super.init(frame: frame)
self.setup()
}
required init?(coder: NSCoder) {
super.init(coder: coder)!
self.setup()
}
func setup() {
layer.cornerRadius = 5.0;
layer.masksToBounds = false
layer.shadowOffset = CGSize.init(width: 0, height: 3)
layer.shadowColor = UIColor.gray.cgColor
layer.shadowRadius = 3
layer.shadowOpacity = 0.4
}
}
更多