Hello I can't figure out how to make a cut corners menu in jetpack compose 1.0.0-beta02
. I tried wrapping the while menu with a surface but It didn't work.
TopAppBar(
modifier = Modifier
.statusBarsPadding(),
title = {
Text(text = "Title")
},
actions = {
var menuExpanded by remember { mutableStateOf(false) }
IconButton(onClick = { menuExpanded = true }) {
Icon(Icons.Default.MoreVert, contentDescription = null)
}
DropdownMenu(
expanded = menuExpanded,
onDismissRequest = {
menuExpanded = false
},
) {
DropdownMenuItem(onClick = {}) {
Text("Item 2")
}
}
},
)
Which gives me
But I need something like this, which is rounded.
Using a M2 MaterialTheme theme, the default shape used by the
DropdownMenu
is defined by themedium
attribute in theshapes
used in theMaterialTheme
(check your theme).You can change this value in your theme or you can override the medium shape only in your
DropdownMenu
.Something like:
Using a M3 MaterialTheme the default shape used by the DropdownMenu is defined by the
extraSmall
attribute in the shapes: