I have UIView which I need to draw a border only partial part view, this is how my design look alike, how do i make it ?
expected
2
Try this
import UIKit class ViewController: UIViewController { @IBOutlet weak var droppedView: UIView! override func viewDidLoad() { super.viewDidLoad() droppedView.clipsToBounds = true droppedView.layer.cornerRadius = 24 // 얼만큼 둥글게 할 것인지 droppedView.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner] droppedView.backgroundColor = .systemGray6 } }
@IBOutlet weak var shadowVw: UIView! override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) shadowVw.layer.cornerRadius = 24 shadowVw.layer.maskedCorners = [.layerMinXMinYCorner,.layerMaxXMinYCorner] shadowVw.backgroundColor = .systemGray6 shadowVw.layer.shadowColor = UIColor.lightGray.cgColor shadowVw.layer.shadowOpacity = 0.7 shadowVw.layer.shadowOffset = CGSize(width: 0.0, height: -5.0) shadowVw.layer.shadowRadius = 5 }
Click here to cancel reply.
2
Answers
Try this