Does anyone know how to change the order of photos in stack view(both horizontal and vertical) by user's desire?
Asked
Active
Viewed 1,129 times
1 Answers
1
The fiddly way is to use
addArrangedSubview()
insertArrangedSubview()
removeArrangedSubview()
If you have more time, I'd consider looking into UICollectionView which has a lot more flexibility that StackViews, especially for things like rearrangement.

XmasRights
- 1,427
- 13
- 21
-
I mean not delete existing and adding new. For example like sorting table view, and i want to sort stack view. – Andreas Mar 29 '16 at 10:13
-
That's the only way to do it with a UIStackView, the array of views it contains is read-only. Have a look at UICollectionView. – XmasRights Mar 29 '16 at 16:26
-