MKMapView inside a UIScrollView

For my app, I need to have a static MKMapView dispaying the user's location inside a scroll view.


Right now, I have the map in the scroll view and all the code that is supposed to make the map function in place, but the map just doesn't show up, and the scroll view seems to have disappeared. Nothing in the scroll view shows up at all, and the scroll bar on the side is gone, so I'm guessing that means the scroll view itself has just vanished completely.


I'm not getting any errors or anything, it just won't show up.


Does anyone know how to fix this?

Thanks in advance. Any help is appreciated.

Answered by JD Adite in 296861022

Hello Adalex3,


I think you need to set proper layout constraint.

And make sure while giving you constraint in ScrollView it's relative to each other, and make sure the first view top constraint and last view bottom constraint giving properly to scroll view and then after it's getting properly scroll.

And scroll view never vanished its child view.

Accepted Answer

Hello Adalex3,


I think you need to set proper layout constraint.

And make sure while giving you constraint in ScrollView it's relative to each other, and make sure the first view top constraint and last view bottom constraint giving properly to scroll view and then after it's getting properly scroll.

And scroll view never vanished its child view.

MKMapView inside a UIScrollView
 
 
Q