https://kotlinlang.org logo
#compose
Title
# compose
h

henrikhorbovyi

06/06/2020, 11:24 PM
Is there a plan to create a
Center
composable? example
Copy code
Center {
    Text("I'm in the center now")
}
m

matvei

06/06/2020, 11:30 PM
We, in fact, had this component in the beginning and removed it to substitute with other APIs for a good reason 🙂 Can you share you usecase? I believe we may have APIs already that might help you achieve what you want but if no -- please, let me know what you want to do! • If you want to center this Text component in whatever constraints it was put in, please, try then
Modifier.wrap(Alignment.Center)
so Text will relax constaints put in it and center itself in the parent layout, if possible. • If you want to center it in a
Stack
or a
Column / Row
this components has scopes that provide modifiers to center within themselfes as well.
🙏🏼 1
h

henrikhorbovyi

06/07/2020, 12:02 AM
Oh! I got it
My case was the first you mensioned. And I didn't know about
Modifier.wrap
Happy to know that 😄
Thanks for your help
😉 1