Note that there are some explanatory texts on larger screens.

plurals
  1. POiOS Autolayout With Unknown Heights
    primarykey
    data
    text
    <p>I am trying to setup my views as follows</p> <p><a href="http://i40.tinypic.com/2eulm4z.png" rel="nofollow noreferrer">layout http://i40.tinypic.com/2eulm4z.png</a></p> <p>Each view contains a number of child views such as labels and buttons. For my project, I must use autolayout. Specifically, I'm using a 3rd party library called FLKAutolayout which just makes things faster. The problem is that each of these views has a dynamic height. It's fine to pin both sides of each view to each side of the parent view. However, when it comes to arranging things vertically, I am encountering ambiguous layouts. I've tried to pin view 1 to the top of the superview, view 2's top pinned to view 1's bottom, view 3's top pinned to view 2's bottom, and so on. If I don't pin the bottom most view to the bottom of the superview, nothing shows up. If I do pin the bottom most view to the bottom of the superview, only the top most view gets stretched to the full size of the screen. If I manually constrain the heights to arbitrary amounts, things show up fine. The problem with that of course is that I don't actually know what the heights should be since they vary depending on the contents.</p> <p>Is there a good strategy to manage an array of views with variable heights? Also, I think I need to add that it is possible (and likely) that the total height of the views will be greater than the size of the height of the view controller's view which contains these vertical views. Eventually I want to be able to scroll through them with a UIScrollView but for now it is okay for them to just continue on offscreen.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload