Reputation: 133
I am making a custom cell using auto layout, but the auto layout is not applied well.
I set auto layout like this Then, in the end, this shape come out. but this shape that The ratio is not right. why it doesn't match..? i set a autolayout on storyboard...
As far as I know, if the image view in the stack view becomes hidden, the unhidden image view is filled in the rest of the stack view space. is it right? if it's right. I make the code
if imageView == nil{
imageView.isHidden = true }
Upvotes: 0
Views: 88
Reputation: 77672
I'm going to guess at some of your constraints...
Here's my example layout:
The "Diamond" image view positions are:
1 3
2 4
Both Vertical stack views (V-Stack-Left
and V-Stack-Right
) have the same settings:
If we set Alignment: Center
for the Horizontal stack view (H-Stack
):
Setting diamond4.isHidden = true
gives this result:
If we set Alignment: Top
for the Horizontal stack view (H-Stack
):
Setting diamond4.isHidden = true
gives this result:
Upvotes: 1