Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MKMapkit constraint error when reopen project

I built a custom view controller. It has 1 tableview, 2 views and 1 map. When I set the constraints for this layout it works fine. I close project and reopen the map view out of the view controller. The width and height are 1000 points. If I set the map on top of this stack, there is no problem. But when I set map in the middle of the other views, a problem happens. I must put this mapview inside another view or it affects the others, but the problem is still there.

I use Xcode 8 beta 5, and constraint is 0 0 0 0

enter image description here

like image 711
trquoccuong Avatar asked Aug 15 '16 12:08

trquoccuong


1 Answers

I have the same issue in the latest beta. I believe the problem is in the wrong default size, that is always set to 1000x1000 by Xcode for MKMapView.

I would wait for the fix in the next Xcode version.

If you, by some reason, really need it fixed now, you can setup a UIView with constraints as required, then put MKMapView inside the UIView and use Autoresizing to scale it.

enter image description here

like image 187
Peyotle Avatar answered Oct 02 '22 08:10

Peyotle