You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Android Studio中Jetpack Compose Column自动补全添括号设置咨询

解决Jetpack Compose Column自动补全不带括号的问题
  • 打开Android Studio设置:Windows/Linux路径为File > Settings,Mac路径为Android Studio > Settings
  • 在设置搜索框输入Kotlin,进入Editor > Code Style > Kotlin配置页
  • 切换到Code Generation标签
  • 在Function call parentheses板块,找到When calling function with trailing lambda选项,选择Always add parentheses
  • 点击Apply和OK保存设置

完成上述操作后,使用自动补全生成Column代码时,就会自动带上空括号:

Column() {        
}

注:该设置会对所有带尾随lambda的Kotlin函数生效,比如Row、Box等Compose组件也会遵循此规则。

内容的提问来源于stack exchange,提问作者Tonnie

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.28 15:04:50