android - How to reduce height of a composable to wrap content without padding - Stack Overflow
I'm using DropDownMenuItem
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?
DropdownMenu(
modifier = Modifier.background(Color.Yellow),
expanded = expandedFile,
onDismissRequest = { expandedFile = false }
) {
DropdownMenuItem(
modifier = Modifier.background(Color.Blue),
text = {
Text(
modifier = Modifier.background(Color.Red),
text = stringResource(Res.string.exit)
)
}
)
}
I tryed all this:
DropdownMenuItem(modifier = Modifier.background(Color.Blue).padding(0.dp)
.sizeIn(minHeight = 0.dp).height(IntrinsicSize.Min),
contentPadding = PaddingValues(0.dp),
None worked
最新文章
- SaaS 的历史与变革
- 为何政府机关被禁止采购Win 8系统?
- 鲍尔默安抚硬件伙伴:Surface只是一个参考设计
- 软硬件一体化模式席卷IT业:厂商策略各有不同
- "双核"创新造就苹果辉煌
- 抓住“苹果”的尾巴,国产平板的突围之路
- reactjs - CORS issue from React to Flask - Stack Overflow
- reactjs - LLM Endpoint hosted in Azure databricks Response 200 but body is locked - Stack Overflow
- express - What is the point of http-only cookies and how to make your authentication secure? - Stack Overflow
- typescript - Declare object and internally refer to other values - Stack Overflow
- python - testing the output of seaborn figure level plots - Stack Overflow
- typescript - How to correctly mock an express middleware with jest? - Stack Overflow
- node.js - Cookies Blocked in Cross-Origin Requests Between Netlify Frontend(Reactjs) and Railway Backend (Node ts) - Stack Overf
- How to log information in Spring application when request is received and before response is returned - Stack Overflow
- c++ - How to create a class setup where two classes each holds an instance of the other? - Stack Overflow
- javascript - Firebase Auth link - Problem with the Google login, no possibility to change to own project name - Stack Overflow
- python - How Can I Use GPU to Accelerate Image Augmentation? - Stack Overflow