温馨提示:本文最后更新于
2024-07-05 20:35:55
,某些文章具有时效性,若有错误或已失效,请在下方留言。问题描述
在 list
中的一列中设置多个按钮会出现同时触发的问题

解决方案
增设按钮的类型属性 .buttonStyle(.borderless)
,也可以选择其他的按钮类型。
Button("Add to Red") { redScore += 1 }
.buttonStyle(.borderless)
Button("Add to Blue") { blueScore += 1 }
.buttonStyle(.borderless)

© 版权声明
THE END
暂无评论内容