2

Xcode 8 beta 8S128d
Interface Builder and Autolayout has always puzzled me. I can simply not make it do what I want.

Example: Just need an ImageView to fill up the screen(parent), but from the top the ImageView should be be proportional to the top.

------------------
- 10% free space -
------------------
-                -
-   MapView      -
-                -
------------------
  1. Add MKMapView to Parent View.
  2. Pin: Right, Left, bottom = 0.
  3. Add Equal to hight for the parent and set the multiplier to 0.90

This works for ImageView but not for MapView.

Chris G.
  • 23,930
  • 48
  • 177
  • 302

1 Answers1

0

I don't have a solution but a viable Workaround

Instead of pinning the map to the borders of the enclosing container do the following

1) give equal width and heigth for mapview and its container 2) manually change height constraint from 1 to 0.99 3) center mapview horizontally and vertically in container.

You'll need some retries but it works

Edit: Caveat: Interface Builder keeps complaining about missing Y-constraint after crash (and re-entering warnings) but the app lays out well.

Struggled with this in Xcode Version 8.0 and Swift 3 - it might be, that in future revisions of Xcode this problem will be solved

Ulrich Hkns
  • 101
  • 8