https://kotlinlang.org logo
l

loloof64

11/23/2020, 8:23 PM
Hi again : what is a simple way to center a component ? Either horizontally/vertically/in both directions ? I can't manage to handle centering carefully...
I've tried this, but it has no effect
Copy code
Column(
                    verticalArrangement = Arrangement.Center
            ) {
                Text("Hello !")
                // StaticChessBoard(modifier = Modifier.preferredSize(300.dp))
            }
k

Kshitij Patil

11/23/2020, 8:25 PM
You can use respective alignment/arrangement parameters or more general solution would be
Modifier.fillMaxSize().wrapContentSize()
(I'm not sure if this is correct way though)
🌮 1
l

loloof64

11/23/2020, 8:27 PM
Thank you very much 😃 It worked.