Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add "Align bottom to: parent view" system constraint?

Just created a demo single view controller project. Controller view contains collection view, and it contains cell view (orange). Cell view contains a view (selected inside) and I need to align it to bottom of cell view. However, when I select orange view inside cell view, press Ctrl and drag it to cell view I don't see "Align bottom to container view" or similar. There's only "Bottom Space to Container" selection and I'm not sure does it have the same behaviour:

enter image description here

And if I select "Bottom Space to Container" and don't get desired "Align bottom to parent" system constraint:

enter image description here

I need to add a new label in existing code base with auto layout, and the label must be positioned next to existing label that has "Align bottom to: parent cell" system constraint:

enter image description here

There's some setting "Bottom edges" if I select my new label and press align button icon at the bottom. However, this selection is disabled anyways and I assume this is user constraint but I need system constraint "Align bottom to: parent cell". Any suggestions why existing label has this constraint but I can't add a similar one to the new label?

enter image description here

like image 561
Centurion Avatar asked Oct 30 '13 08:10

Centurion


1 Answers

Just faced the situation in which the bottom constraint was being pinned to the Bottom Layout Guide (a TabBar, in my case) instead of to the superview, as I wanted.

After tinkering around with programmatically created and or modified constraints, I found that you could actually do it through Autolayout's Pin Popover, just by selecting View instead of Bottom Layout Guide in the drop down that appears if you clic on the little arrow of the constraint's textfield.

That was, probably, not very clear, so here:

enter image description here

like image 67
Thecafremo Avatar answered Oct 02 '22 16:10

Thecafremo