Thread
#compose
    Nat Strangerweather

    Nat Strangerweather

    1 year ago
    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.
    val max = 202.dp
    val min = 24.dp
    val offsetPosition = remember { mutableStateOf(0f) }
    z

    zoha131

    1 year ago
    I think you need to convert 24.dp to pixel. I can achieve that this way:
    val offsetPosition = with(DensityAmbient.current) { 24.dp.toPx() }
    Nat Strangerweather

    Nat Strangerweather

    1 year ago
    Perfect, many thanks! 🙂