Paul T.
Paul T.

Reputation: 5038

MKMapView contraints in storyboard issue

I have this constaints for map view

enter image description here

enter image description here

But I have this error

enter image description here

If I replace map view with UIView, everything is OK

Update

To reproduce you need to set settings of view controller like this:

enter image description here

Upvotes: 1

Views: 329

Answers (3)

Divyesh Gondaliya
Divyesh Gondaliya

Reputation: 904

Try to add constraint like equal width to view and equal height to view.

I think any other constraint would create a error. First check all the constraints of your view.

Upvotes: 0

superpuccio
superpuccio

Reputation: 12972

I experienced the same issue when I tried to put an MKMapView as a full screen view. To do so I set:

  • Center horizontally
  • Center vertically
  • Equal widths
  • Equal heights

These above are referred to the MKMapView's superview (the main controller view). And xCode kept saying me "Error: missing constraints for Y position". I had never seen this error doing the way I did. I solved with these other four constraints (equivalent in my opinion):

  • Leading space 0
  • Trailing space 0
  • Top space 0
  • Bottom space 0

Always referred to the MKMapView's superview (the main controller view).

Upvotes: 1

Rajan
Rajan

Reputation: 1568

OK got it solved at my end. Change the MKMapView's frame x:0 y:0 Width:375 Height:554 and than see is it still there or not.

See the setting. It is as same as you have

Update the frame

Note: Sorry Don't know How to add images in answer.

Upvotes: 1

Related Questions