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

ste

06/06/2021, 9:36 AM
Hi all...
start.linkTo(anchor = parent.start, margin = 36.dp)
leads to the first image (start margin is okay, but I'd like to set a end margin too) But when adding
end.linkTo(anchor = parent.end, margin = 36.dp)
, it leads to the second image, where none of the margin is okay because the text is too large. What can I do? Adding a
padding
won't work because the lower text (
0
) wouldn't be aligned to the upper text
c

Colton Idle

06/06/2021, 1:00 PM
Are you using CL? This looks like something that you can do fairly simply with a Column?
s

ste

06/06/2021, 3:04 PM
@Constantine Yup I'm using
ConstraintLayout
. Also yup, I could do that with a
Column
, but the layout will be more complex than this, don't want to nest many
Rows
and
Columns
. The problem here is width exceeds margins
c

Colton Idle

06/06/2021, 8:44 PM
Nesting rows and columns are basically free in compose. As far as Adam powell said at some point.
s

ste

06/07/2021, 11:12 AM
@Colton Idle Yup I know, but a heavily nested just hurt my eyes and brain! I solved. btw!
kotestSolved: I had to set
width = Dimension.fillToConstraints
within the
ConstraintScope