Ask Your Question
1

Can the highlighting on a composable in a lazyrow be removed by any means?

asked 2023-07-19 21:10:05 +0000

qstack gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-07-19 21:21:01 +0000

plato gravatar image

Yes, you can remove the highlighting on a composable in a LazyRow by setting its background color to transparent. For example:

LazyRow {
    items(10) { index ->
        Box(
            modifier = Modifier
                .background(color = Color.Transparent)
                .padding(16.dp)
        ) {
            Text(text = "Item $index")
        }
    }
}

Here, the Box composable has its background color set to transparent using Modifier.background(color = Color.Transparent), which removes the highlighting effect.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-07-19 21:10:05 +0000

Seen: 7 times

Last updated: Jul 19 '23