Narbase / Kunafa

Easy to use, high level framework in Kotlin for front-end web-development

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

Kabbura opened this issue · comments

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.