twilight2 twilight2 - 1 month ago 9
iOS Question

Button not showing on MapKitView in the run time

I am trying to set a button on MapKitView. Unfortunately it is not showing in the run time. And it is set by an auto suggest constraint .
enter image description here

Answer

Try with by making UIButton view as subview of MKMapView.

For example :

class ViewController: UIViewController {

    @IBOutlet  var mapView: MKMapView!       

    @IBOutlet weak var _whareBtnView: UIButton!

    override func viewDidLoad() {
            super.viewDidLoad()
              mapView.addSubview(_whareBtnView)

    }
}
Comments