我希望这个子视图能够超出其父视图,但是父视图的边框会切割子视图。有没有办法防止这种情况发生?
class TheView : UIView {
let theSubView = UIButton()
override init(frame: CGRect) {
super.init(frame: frame)
layer.borderColor = UIColor.gray.cgColor
layer.borderWidth = 1
clipsToBounds = false
addSubview(theSubView)
theSubView.backgroundColor = UIColor.green
theSubView.frame = CGRect(x: 0, y: -10, width: 50, height: 50)
}
}