FlexLayout icon indicating copy to clipboard operation
FlexLayout copied to clipboard

The same code get different results in versions 1.3.33 and 2.0.07.

Open xia0m1ng opened this issue 1 year ago • 0 comments

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: IMG_145755

in 2.0.07: IMG_14566

I'm not sure if this is Yoga‘s bug.

xia0m1ng avatar Mar 08 '24 03:03 xia0m1ng