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

BUG: width: matchParent with maxWidth with does not allow the view to be centered. #3

Open
Kabbura opened this issue Mar 19, 2019 · 0 comments

Comments

@Kabbura
Copy link
Member

Kabbura commented Mar 19, 2019

Given

        horizontalLayout {
            style {
                height = 400.px
                width = 400.px
                justifyContent = JustifyContent.Center
            }

            verticalLayout {
                style {
                    width = matchParent
                    maxWidth = 280.px
                    height = 200.px
                    backgroundColor = Color.red
                }
            }
        }

The expected behavior is for the child view to be centered vertically inside the parent view. However, matchParent sets alignSelf to stretch and as such, the view will not be centered.
The current work around is to set width to 100.percent instead of matchParent.

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