我的代码看起来像这样
Dialog(onDismissRequest = {}) {
val dialogWindowProvider = LocalView.current.parent as DialogWindowProvider
dialogWindowProvider.window.setGravity(Gravity.BOTTOM)
Surface(
shape = RoundedCornerShape(16.dp),
elevation = 0.dp,
color = Color.Transparent,
modifier = Modifier
.padding(bottom = 24.dp)
.fillMaxWidth(),
) {
}
}
字符串
我可以改变底部填充为0,它将是0,但无论我做什么,总是有水平填充像18dp,我怎么才能删除它?请不要建议使用AlertDialog
1条答案
按热度按时间tjvv9vkg1#
只需要添加参数:
properties = DialogProperties(usePlatformDefaultWidth = false)
以达到预期的效果。Image result字符串
更多信息:https://developer.android.com/reference/kotlin/androidx/compose/ui/window/DialogProperties的