Skip to content

The order of the modifier parameters is important for the proper layout build #18

@GitSmoosher

Description

@GitSmoosher

modifier = modifier
.fillMaxSize()
.background(backgroundColor)
.padding(16.dp),

modifier = modifier
.fillMaxSize()
.padding(16.dp)
.background(backgroundColor),

These two orderings of the modifier settings, for the quadrant Column, produce a different layout. - if padding is ahead of background - Compose does the padding part first then it colors the space between the padding borders, thus leaving a colorless area between padded area that has the text and the borders of the column.

I have modified slightly the code for the solution and have a second function - ComposableQuadrantWithPadding - that builds a column but this time with the padding setting ahead of the background, see the attached image file with a screenshot that shows the code and the result. Is this how the Modifier class is supposed to work or is this some kind of a bug?

BugWhenUsingPaddingAheadOfBackgroundColor

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions