首页
注册
登录
od66666666
V2EX 第 528596 号会员,加入于 2021-01-16 12:59:38 +08:00
今日活跃度排名
3594
od66666666
提问
技术话题
好玩
工作信息
交易信息
城市相关
根据 od66666666 的设置,主题列表被隐藏
二手交易
相关的信息,包括已关闭的交易,不会被隐藏
od66666666 最近回复了
1 天前
回复了
magic3584
创建的主题
›
Android
›
请教个 Jetpack Compose 的布局问题
遇 size 不决,直接 onGloballyPositioned
Row(modifier = Modifier.fillMaxWidth()) {
val density = LocalDensity.current
var columnHeight by remember { mutableStateOf(0.dp) }
Box(
modifier = Modifier
.height(columnHeight)
.width(24.dp),
contentAlignment = Alignment.Center
) {
...
}
Spacer(Modifier.width(8.dp))
Column(modifier = Modifier
.onGloballyPositioned { layoutCoordinates ->
columnHeight =
with(density) { layoutCoordinates.size.height.toDp() }
}
.fillMaxWidth(),
verticalArrangement = Arrangement.spacedBy(8.dp)) {
...
}
}
»
od66666666 创建的更多回复
关于
·
帮助文档
·
博客
·
API
·
FAQ
·
实用小工具
·
1081 人在线
最高记录 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 10ms ·
UTC 23:07
·
PVG 07:07
·
LAX 16:07
·
JFK 19:07
Developed with
CodeLauncher
♥ Do have faith in what you're doing.