FlexLayout
FlexLayout copied to clipboard
The same code get different results in versions 1.3.33 and 2.0.07.
The code is simple:
class Example1ViewController: UIViewController {
let root = UIView()
override func viewDidLoad() {
super.viewDidLoad()
view.addSubview(root)
root.flex
.direction(.row)
.wrap(.wrap)
.define { flex in
for _ in 0...7 {
flex.addItem()
.justifyContent(.center)
.alignItems(.center)
.width(25%)
.aspectRatio(1)
.backgroundColor(.green)
.border(1, .red)
.define { flex in
flex.addItem()
.width(60%)
.aspectRatio(1)
.backgroundColor(.blue)
}
}
}
}
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
root.pin.all(view.pin.safeArea)
root.flex.layout(mode: .adjustHeight)
}
}
in 1.3.33:
in 2.0.07:
I'm not sure if this is Yoga‘s bug.