Im trying to make a DropDownMenu that is going to have transparent background, so that user can see only it's content.
I've tried to achieve that by wrapping the DropDownMenu into MaterialTheme composable and override the colors property, and this is almost successful, but I can see the border and elevation of the Card (i guess) composable used for implementing DropDownMenu. Is there a way to make it fully transparent? Here is the code example:
MaterialTheme(
colors = MaterialTheme.colors.copy(
background = Color.Transparent,
onBackground = Color.Transparent,
surface = Color.Transparent
)
) {
ListItemComposable(
modifier = Modifier.align(Alignment.TopCenter),
text = dropDownItems.first().name,
onClick = { isDropDownMenuVisible = true }
)
DropdownMenu(
expanded = isDropDownMenuVisible,
onDismissRequest = { isDropDownMenuVisible = false },
) {
dropDownItems.forEach { dropDownItem ->
DropdownMenuItem(
onClick = { isDropDownMenuVisible = false }
) {
ListItemComposable(
modifier = Modifier,
text = dropDownItem.name
) {}
}
}
}
}