Layout Interface Builder constraints issue since Xcode 8

前端 未结 2 1034
忘掉有多难
忘掉有多难 2021-02-07 13:07

Since I have updated my Swift project to Swift 2.3 and Xcode 8 (release version) I can\'t get my Interface done anymore:

I\'m setting all the constraints perfec

相关标签:
2条回答
  • 2021-02-07 13:13

    Quick workaround: change the desired controllers' simulated size to freeform in inspector and then update frames. Looks like freeform controllers are not affected by these new Xcode 8 IB features :)

    0 讨论(0)
  • 2021-02-07 13:16

    I'm working on a large project with multiple storyboards and lots of viewcontrollers. Had same issues on most of them. And figured it is happening because Xcode now supports constraints with decimal values.

    Here is the fix worked for all of my UITableViews and UICollectionViews:

    1) Remove only one of the "Height equals: xx" constraint from one of your views inside the cell.
    2) Update all frames.
    3) Select the view you removed constraint from.
    4) Click to add new constraint button. Now it should be showing a new height, probably with a decimal value.
    5) Add height constraint without changing the value inside the box.

    Your problem should be fixed for that cell now. Repeat this steps for all cells that are broken. Hope this solution works for you as well. Good luck!

    0 讨论(0)
提交回复
热议问题