如何让 ToolbarItem 将primaryAction 加粗?我已经能够通过在导航视图上设置强调色来更改颜色。主要寻找 SwiftUI 解决方案,但如果不可能,我会选择 UI Kit 解决方案。我的代码:
.toolbar {
ToolbarItem(placement: ToolbarItemPlacement.primaryAction) {
Button(action: { }) {
Text("Save")
.fontWeight(.black) // does nothing
.bold() // does nothing
}
}
}
Run Code Online (Sandbox Code Playgroud)
PrimaryAction 位置未加粗:

默认情况下,主要配置以粗体显示:
