adjpd
09/13/2021, 8:41 PMModifier
your code won't compile? See 🧵.adjpd
09/13/2021, 8:42 PMColumn {
Box {
Text("hi", Modifier.align(Alignment.End))
}
}
This won't compile because both Column
and Box
have the same modifier Modifier.align
The compiler cryptically tells you:
'fun Modifier.align(alignment: Alignment.Horizontal): Modifier' can't be called in this context by implicit receiver. Use the explicit one if necessary
adjpd
09/13/2021, 8:43 PMZach Klippenstein (he/him) [MOD]
09/13/2021, 9:15 PMAlignment.End
is an Alignment.Horizontal
, not an Alignment
. Those two interfaces are not actually related by subtyping. BoxScope.align
takes the latter, so I think you need to pass something like TopEnd
, CenterEnd
, or `BottomEnd`: https://developer.android.com/reference/kotlin/androidx/compose/ui/Alignment.Companionadjpd
09/13/2021, 9:27 PMAlignment
is different locations is rather perplexing.Zach Klippenstein (he/him) [MOD]
09/13/2021, 9:50 PMadjpd
09/14/2021, 9:37 AMZach Klippenstein (he/him) [MOD]
09/14/2021, 2:21 PMadjpd
09/14/2021, 2:58 PMZach Klippenstein (he/him) [MOD]
09/14/2021, 3:05 PM