I would like the blue container view to be the same height as the orange container view. I am using proportional sizing to do so (all of these are within a vertical stack)I selected all of the containers then added the equal heights constraint to them. I am confused because there does not seem to be a proportional height constraint for the blue container view. I was able to change the proportional heights of the others just fine.
Proportional sizing using equal heights missing constraint
90 views Asked by Summer At
1
There are 1 answers
Related Questions in AUTOLAYOUT
- Align image inside DTImageTextAttachment
- How to right align a UIStackView inside a UIScrollView when the stack view's size is smaller than scroll view?
- UIView animation layoutIfNeeded causes top Constraint to break at the start of animation if not called on superview
- Sizing DTAttributedTextContentView based on its attributedString
- Can't locate storyboard constraints warnings in Xcode
- layerClass breaks auto layout
- AppKit NSTextField and AutoLayout : how to set programmatically a specific width?
- How to dynamically controls constraint to active them without manually doing calculation and set active by my self?
- UILabel not drawing text properly in UICollectionViewCell
- iOS: When layoutIfNeeded() is called on a specific subview, it is not displayed on the screen
- Modifications to the layout engine must not be performed from a background thread on iOS 17 and above
- Content hugging and content compression resistance with minimum margin between views
- Auto Layout Constraint Conflict in SwiftUI When Tapping TextField
- NSStackView giving too much space to collection view despite constraints
- UICollectionView - constraints warning when I reselect item
Related Questions in PROPORTIONS
- Distribution of the difference of two beta random variables: Issue implementing it
- Using R or tidyverse to adjust proportion in my dataframe to match a known parameter (using prop.table or table or anything else)
- "This initial value does not corresponding to a stochastic node in WINBUGS
- Can I use neuronal networks from the R package nnet to model compositional data?
- How to replace for loop in pandas Dataframe?
- Calculate the proportion of bacteria and protein in R (R-beginner question)
- Keeping proportions when exporting ggplots
- Calculating conditional proportions from R data.frame
- Compare the distribution of normalized numbers of mutations
- Error in svyciprop using logit or likelihood method
- Error while creating a proportions table in R: Error in table(st2.affect) : attempt to make a table with \>= 2^31 elements
- Calculate font height at different size, how to find find ratio?
- Computing number of participants by timepoints
- ggplot to visualize temperature extreme return event, SPM.6 IPCC 2021
- How to do two proportion prop.test for each single row in a data frame?
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)


The layout is exactly what you've specified for the Heights:
If you want "the blue container view to be the same height as the orange container view", you need to set
You do not set a "proportional height" constraint on the Blue Container itself, because you've already told the stack view to fit all the views based on those Height constraints.
Edit - in response to comment: "I would like the blue itself to be smaller like the orange appears"
If you write this out (or speak it), you can probably answer the question yourself...
I want :
So...
Maybe this will help you understand...
We don't assign a Height to the Blue view, because we are using the Height of the stack view to arrange its subviews.
So, let's assume the stack view Height is 450-points, either by setting it or by setting Top and Bottom constraints - and it just happens to be 450 because it will give this example nice numbers.
If we have Two views - Blue and Orange - and we want them the same Height, it looks like this:
Very simplified, auto-layout says: "Blue has a Height of 1 unit, Orange is equal to Blue, so it also has a Height of 1 unit. 1 + 1 == 2, for a total of 2 Height units, so divide 450 by 2 and give each view a height of 225"
If we want Orange to be twice as tall as Blue, we constrain
Orange.Height = Blue.Height with Multiplier: 2and we get this:Auto-layout says: "Blue has a Height of 1 unit, Orange is equal to Blue x 2, so it has a Height of 2 units. 1 + 2 == 3 total Height units...
450 / 3 == 150, so give Blue a Height of1 x 150 == 150and give Orange a Height of150 x 2 == 300".For your layout, it looks like this:
We now have a total of 9 Height units (
1 + 1 + 2 + 2 + 2 + 1), and auto-layout says: "450 / 9 == 50(per Height unit) ..." and you can see how it lays out the views.