Reputation: 23391
As title says, I have a compose Column where I center the contents vertically but I want an icon in top left.
Upvotes: 0
Views: 64
Reputation: 10992
If you want the Column
content be centered in the screen without having any offset from the Icon
on the top, then use a Box
as suggested in the comments:
Box(
modifier = Modifier.fillMaxSize()
) {
Column(
modifier = Modifier.matchParentSize(),
verticalArrangement = Arrangement.Center
) {
// ...
}
Icon(
modifier = Modifier.align(Alignment.TopStart)
)
}
Note that with this approach, the Icon
could overlap the Column
items when the Column
is filling the full screen height.
Upvotes: 1