In this example, I need my offsetPosition to be eq...
# compose
n
In this example, I need my offsetPosition to be equal to my min value. How can I do that? If I put 24.0f as offsetPosition, I am not in the right place.
Copy code
val max = 202.dp
val min = 24.dp
val offsetPosition = remember { mutableStateOf(0f) }
z
I think you need to convert 24.dp to pixel. I can achieve that this way:
Copy code
val offsetPosition = with(DensityAmbient.current) { 24.dp.toPx() }
👍 2
n
Perfect, many thanks! 🙂