質問

I'm trying to code the tutorial on https://developer.apple.com/wwdc/videos/ (What’s New in Map Kit).

What I'd like to have is a Window with a map inside of it. If I resize the window, the map gets resized as well (just like in the tutorial).enter image description here

My problem is, that my MapView doesn't get enlarged as I zoom the Window. It just stays the size I initially set it to. In the tutorial the developer has constraints on his view. Maybe that's the reason, but on the View which holds the Map View the resize setting is set so, that descendants should be resized as well.

What setting am I missing? Unfortunately I don't have any code to show because the problem is related to Xcode / UI design.

役に立ちましたか?

解決

I finally figured out what I was doing wrong. After declaring the layout I had to add constraints to the view. After reading Understanding Layout Constraints in the documentation I was able to add the constraints to my user interface:

I had to click on this icon on the bottom right: enter image description here After that I could add the constraints to the view which holds my map view like this:

enter image description here

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top