如何以编程方式重新排序 IOS 中的 UIStackView 中的项目?

how to programmatically reorder items within a UIStackView in IOS?

如何以编程方式重新排序 IOS 中 UIStackView 中的项目?

(即我在 https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIStackView_Class_Reference/#//apple_ref/doc/uid/TP40015256-CH1-SW30 处看不到涵盖此功能的功能)???

当然可以组合使用

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

重新排列您的视图?

将视图添加到父视图时,它会自动从其旧父视图中删除。

这个和arrangedView一样,所以你只需要使用insertArrangedSubview(_:atIndex:)addArrangedSubview()

不需要使用 removeArrangedSubview()