Reputation: 4409
Added UIView
of (50 height) to superview i.e., UIView
a 50 % hold inside remaining outside to superview.
After adding corner radius to superview the below half of bottomView is not shown.
extension UIView{
func roundCorners(_ corners: UIRectCorner, radius: CGFloat) {
let path = UIBezierPath(roundedRect: self.bounds, byRoundingCorners: corners, cornerRadii: CGSize(width: radius, height: radius))
let mask = CAShapeLayer()
mask.path = path.cgPath
self.layer.mask = mask
}
}
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
bg_view.roundCorners([.bottomLeft, .bottomRight], radius: 20). // MainView
SearchView.bringSubviewToFront(bg_View)
}
Here is storyboard image
Upvotes: 0
Views: 327
Reputation: 654
You should move green view out of your background view which clips its bounds since your are setting cornerRadius. Your green view can have centerY constraint equal to your backgroundViews bottom. In order to achieve this, you can first define vertical spacing between them and then edit that constraints first item to centerY
Upvotes: 0