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
88 Views Asked by Summer At
1
There are 1 best solutions below
Related Questions in AUTOLAYOUT
- UICollectionView cell height/scrollable content behaving strange/incorrect
- Can UIStackView also be used within a UITableViewCell?
- How can I use AutoLayout to place view exactly above other?
- auto layout modify multiplier of constraint programmatically
- iOS 7 - Layout advice
- Aspect fill and Aspect fit swift
- UIVIew from XIB with Autolayout to UItableView Header
- Auto Layout with UIImageView is producing incorrect view layout when an image is shown
- How to remove space of hidden UIImage?
- Using auto layout to arrange views in sequence with one taking whatever space is available
- error when adding constraints to a view I added to UIWindow?
- Constraints error <Will attempt to recover by breaking constraint>
- How would I align an image to the bottom right of the view using Size Classes in Xcode?
- Setting frame for UIButton ignored
- AutoLayout on UITableViewCell subclass breaks after reuse
Related Questions in PROPORTIONS
- Computing number of participants by timepoints
- ggplot to visualize temperature extreme return event, SPM.6 IPCC 2021
- Calculate font height at different size, how to find find ratio?
- calculate the proportion in r
- Proportional sizing using equal heights missing constraint
- grab some columns and calculate the proportion inr
- What are the R functions in normal distribution?
- Filling null values based on the proportion of the categories in that column
- With known proportion/percentage and sample size, populate original data in R
- Data imputation based on the mean of the numeric variable and the frequency count of a categorical variable
- Creating multiple proportion table in R dataframe
- How to estimate a population proportion that has a certain disease
- How to calculate a proportion in R
- Use Anova to compare changes in categorical variable over time in R
- Calculating the proportion of events that were high intensity within the past week
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)
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?


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.