How to create a scroll bar for visual effect when using .verticalScroll or .horizontalScroll in a Column or Row Composable?

18 Views Asked by At

For example, I have a quiz screen and inside the quiz screen, there is a section for radio buttons. In this column, I use the .verticalScroll to scroll down. It works fine but in term of visual effects, the user won't know it is scrollable or not.

Column(
    modifier = Modifier
        .padding(vertical = 16.dp)
        .verticalScroll(state)
) {
    it.choices.forEach { choice ->
        QuizRadioButton(
            text = stringResource(id = choice),
            selected = choice == userAnswer,
            correct = correctness ?: false,
            onSelected = { onAnswerSelected(choice) },
        )
    }
}

A scroll bar is a basic way to help the user to know whether it is scrollable or not.

0

There are 0 best solutions below