how can i draw a border between DropdownMenuItems in jet pack compose?

52 Views Asked by At

how can i draw a border between DropdownMenuItems in jet pack compose?

I want to draw a bottom border or a border between the diferent items in a DropDownMenu in jetpack compose in my Topbar Menu.

I try to do this with de modifier = Modifier.border() but i can't.

1

There are 1 best solutions below

1
BenjyTec On BEST ANSWER

If you are using Material Design 2, check out the Divider Composable:

DropDownMenuItem(/* ... */)
Divider(startIndent = 8.dp, thickness = 1.dp, color = Color.Black)
DropDownMenuItem(/* ... */)

If you are using Material Design 3, check out the HorizontalDivider Composable:

DropDownMenuItem(/* ... */)
HorizontalDivider()
DropDownMenuItem(/* ... */)