I have three views (A, B, C) arranged horizontally. A has a fixed width, B has a maximum width, C has a minimum width and will fill all remaining space to the width of the screen.
B is an image, which scales preserving its aspect ratio.
On a large screen, B reaches its maximum size and looks great. On a very small screen, B disappears altogether, which is fine. However, in between the two, we sometimes have B appear as a very small image - just a few pixels wide and too small to make out.
How can I say, "if B is less than 20 pixels wide, hide it altogether"?
(I have to support iOS 7, so I'd prefer a solution that doesn't use UIStackView.)
You might be able to do this with some priority for your constraints. Making them break when they are not satisfying the view, and then also have a constraint with width zero with the "lowest priority".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With