Anybody know a simple way to hide a label and let the other views of the screen use the place left blank ? And make the opposite when showing back that view. Something like Android setVisibility = GONE for layers.
As far as I know, using setHidden=true only hide the view from the screen but does not rearrange anything around it.
Thank you
The only way to achieve Androids .GONE functionality on iOS is to use a UIStackView
via Apples documentation
Dynamically Changing the Stack View’s Content The stack view automatically updates its layout whenever views are added, removed or inserted into the arrangedSubviews array, or whenever one of the arranged subviews’s hidden property changes.
SWIFT 3:
// Appears to remove the first arranged view from the stack. // The view is still inside the stack, it's just no longer visible, and no longer contributes to the layout. let firstView = stackView.arrangedSubviews[0] firstView.hidden = true
SWIFT 4:
let firstView = stackView.arrangedSubviews[0] firstView.isHidden = true
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