constrain view.bottom to superview.bottom not bottomLayoutGuide in storyboard

自古美人都是妖i 提交于 2019-12-29 04:43:08

问题


In interface builder it only gives me the option of constraining my sub view to the bottom layout guide, not the superview. Because I am sometimes using the controller as a child controller in a container controller setup, I really want to constraint to the superview bottom, not the bottom layout guide.


回答1:


Select your TableView and go to Editor -> Pin.
From there you have 4 options to pin to superview:

  • Leading Space to Superview
  • Trailing Space to Superview
  • Top Space to Superview
  • Bottom Space to Superview

This works as expected. The only downside is that you have to perform the pinning manually, as there are no shortcuts available.




回答2:


As @Trianna Brannon pointed out, the approach in the other answer no longer works in Xcode7. In Xcode7 you have to right click your element, draw a line to the bottom until the constraint selector pops up.

Then press ALT and now you'll get the desired Bottom constraint:



来源:https://stackoverflow.com/questions/29021129/constrain-view-bottom-to-superview-bottom-not-bottomlayoutguide-in-storyboard

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