Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
xia0m1ng opened this issue Mar 8, 2024 · 0 comments
Open

Comments

@xia0m1ng
Copy link

xia0m1ng commented Mar 8, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant