I'm using ConstraintLayout. Can anyone tell me if ...
# compose
d
I'm using ConstraintLayout. Can anyone tell me if I need to specifically set the width of BottomNavigation or is there a way to make it fill the parent (Modifier.fillMaxWidth() does nothing)? Edit: performMeasure in ConstraintLayout.Measurer does this
Copy code
state.width(if (constraints.hasBoundedWidth) {
    Dimension.Fixed(constraints.maxWidth.value)
} else {
    Dimension.Wrap()
})
I'm guessing it would have to call Dimension.spread() in order for it to work in my case or am I wrong?
m
I haven’t played with ConstraintLayout yet, but it looks like you need to set something like
bottomNavigation constrainHorizontallyTo parent
inside a
ConstraintSet
d
@maciejciemiega My constraints are all set
Copy code
val constraintSet = ConstraintSet {
            val bottomNavTag = tag(bottomNav)
            val viewsContainerTag = tag(viewsContainer)

            <http://viewsContainerTag.top|viewsContainerTag.top> constrainTo <http://parent.top|parent.top>
            viewsContainerTag.bottom constrainTo <http://bottomNavTag.top|bottomNavTag.top>
            viewsContainerTag constrainHorizontallyTo parent

            bottomNavTag.bottom constrainTo parent.bottom
            bottomNavTag constrainHorizontallyTo parent

        }
m
then 🤷‍♂️ 😞
😢 1
d
Oh yeah, that would make sense, I guess I have to wait for dev09 😅 Thanks for finding it!
m
Yep, setting dimensions is not possible in dev08, but should come in the next release 🙂
❤️ 1