0

How to change direction of views by one command in UIStackView? For example, I have: View1, View2, View3 horizontally distributed and I want them to be View3, View2, View1 also horizontally distributed

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Ruslan
  • 35
  • 7

1 Answers1

1

I am not sure it is possible in one command, but simply remove all subviews and re-add all subviews in reverse order (but last one if you want to optimize)

removeArrangedSubview(_:)
insertArrangedSubview(_:atIndex:)

As stated how to programmatically reorder items within a UIStackView in IOS?

Community
  • 1
  • 1
jalone
  • 1,953
  • 4
  • 27
  • 46