Hello, is there a better way to center align this ...
# compose
n
Hello, is there a better way to center align this icon button to the text rather than using offset? It a little bit looks off to me.
1
c
I guess you already put them in a
Row
If yes, the Row has a
verticalAlignment
parameter to which you can pass
Alignment.CenterVertically
1
👍 1
c
Depending what version of Compose you are using, includeFontPadding may still be on, which has led to less than pixel perfect vertical alignment with Text in the past, which in that case requires tiny nudges with offset 😔
✔️ 2
n
Thank you guys for a quick turnaround, I think I fixed it using custom layout but there is another problem 😞 Even though I wrap both
title
and
description
inside a
Column
, the
description
doesn’t respect to the `title'`s space and overlaps it. Do you know why?
My layout
Copy code
Layout(
    modifier = Modifier
        .padding(horizontal = TRTheme.spacing.default)
        .padding(top = TRTheme.spacing.default, bottom = TRTheme.spacing.single),
    content = {
        ...
    }) { measurables, constraints ->
    ...
ok, instead of
maxHeight
, used placeables’ height and it is fixed 🙂
👍 1