Issue
I am facing below error, I am new in compose
Type mismatch: inferred type is androidx.compose.ui.Alignment.Vertical but androidx.compose.foundation.layout.Arrangement.Vertical was expected
Simply, I know package was mismatch as error.
Code
Column(modifier = Modifier
.padding(16.dp)
.fillMaxWidth(),
verticalArrangement = Alignment.CenterVertically
)
Anyone have idea how to fix it or why this error generate?
Thanks in advance.
Solution
The verticalArrangement
attribute in the Column
requires a androidx.compose.foundation.layout.Arrangement.Vertical
value and you are using androidx.compose.ui.Alignment.Vertical
(used by verticalAlignment
in the Row
).
Use:
Column(
modifier = Modifier
.padding(16.dp)
.fillMaxWidth(),
verticalArrangement = Arrangement.Center
)
Answered By - Gabriele Mariotti
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.