Upgraded to Xcode 9 Swift 4. Now Auto-Layout is whacked

柔情痞子 提交于 2019-12-06 14:02:26

问题


Just updated to Xcode 9 and converted my project to Swift 4 but one of my app screens with a tableview has begun to show as such:

I've removed all but one stack view and just placed all my elements in that one stack view with the constraints clipped to 0,0,0,0

it should look like this:

What's going on here?


回答1:


This was a simple fix once I sat down and looked at it with fresh eyes.

Make sure your constraints are bounding to a view instead of another item in the view.

I cleared constraints and added a stack-view then added constraints carefully making sure it was bounding to a view.



来源:https://stackoverflow.com/questions/46621966/upgraded-to-xcode-9-swift-4-now-auto-layout-is-whacked

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!