relative width and height in storyboard? <p>I've been developing an ios app and the layout is driving me absolutely mad. So i have a CollectionViewCell, in this collectionviewcell i have 2 UIViews. What i want to know is how can i set width and height of my views relative to their parent container. </p> <p>I've already attempted this </p> <pre><code>NSLayoutConstraint *c = [NSLayoutConstraint constraintWithItem:bottomView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:topView multiplier:1.5 constant:0]; </code></pre> <p>from the other stack post but it does nothing.</p> <p>Ive tried to set the height of one of the containers programaticaly but that also doesnt work. Here is the code that sets the layout of the collectionviewCell which is the super view and works.</p> <pre><code> CGFloat screenWidth = screenRect.size.width; CGFloat screenHeight = screenRect.size.height; CGFloat marginWidth = 10.f; CGFloat itemWidth = (screenWidth / 2.0f) - (1.5f * marginWidth); [self layout].itemSize = CGSizeMake(itemWidth, itemWidth * 1.3f); </code></pre> <p>Ive tried to set the height of the view relative to the collectionviewcell with the code below</p> <pre><code> CGFloat height = (((itemWidth * 1.3f)/3)*2); CGRect imageFrame = self.imagePanel.frame; imageFrame.size.width = (screenWidth / 2.0f); imageFrame.size.height = height; [self.imagePanel setFrame:imageFrame]; </code></pre> <p>But again this doesnt work :( How can i achieve this? Is there any way to do this through the storyboard?</p>