loloof64
11/24/2020, 10:39 AM@Composable
MyComposable(size: Dp) {
// how to get size in px ?
}
Because it seems that withDensity
is not available in the newest API.André Kindwall
11/24/2020, 10:44 AM@Composable
fun MyComposable(size: Dp) {
with(DensityAmbient.current) {
size.toPx()
}
}
loloof64
11/24/2020, 10:46 AM