Pablo
01/04/2025, 1:35 PMDropDownMenuItem
with a Text
in a DrowpDownMenu
, and I need to reduce the DropDownMenuItem
height to the height of the Text
, or with a minimum padding of 2.dp
. Now the height of the DropDownMenuItem
is very big on big screens. Is double of the height of the Text
. Also, the parent DrowpDownMenu
is adding even more height. How can that height be reduced to the Text
height? I already tryed setting a modifier with padding 0.dp to both, with no results.
Box {
TextButton(onClick = { expandedFile = !expandedFile }) {
Text(stringResource(Res.string.menu_file))
}
DropdownMenu(
expanded = expandedFile,
onDismissRequest = { expandedFile = false }
) {
DropdownMenuItem(
text = { Text(stringResource(Res.string.exit)) },
onClick = {
expandedFile = false
onExitEvent()
}
)
}
}
Sanlorng
01/04/2025, 2:51 PMPablo
01/04/2025, 2:52 PMSanlorng
01/04/2025, 2:53 PMSanlorng
01/04/2025, 2:54 PMSanlorng
01/04/2025, 2:55 PMPablo
01/04/2025, 7:29 PMmodifier = Modifier.background(Color.Blue).padding(0.dp).sizeIn(minHeight = 0.dp).wrapContentHeight().height(IntrinsicSize.Min),