-2

Basically, in Android I have a LinearLayout of 3 views on top of each other. If I set view 1 to 'View.GONE', view 2 becomes the top view and view 3 is still underneath it. Or if I set View 2 to 'View.GONE', View 1 is now above View 3. I cannot find any answers on how to do this in Xcode for an iOS app. I know there is UIStackView but that is iOS 9+ only, which I don't want. How do I do this? In Swift preferably.

Questioner
  • 2,451
  • 4
  • 29
  • 50

1 Answers1

1

I solved the problem by pinning the views to the other views and then instead of trying to change the height of the view using an outlet of the view I created an outlet of the height constraint and set it to 0, as shown in this answer:

https://stackoverflow.com/a/23655322/4838107

Community
  • 1
  • 1
Questioner
  • 2,451
  • 4
  • 29
  • 50