我正在尝试在SwiftUI中更改actionSheet文本的颜色,但无法做到。我尝试了以下代码。
我正在尝试在SwiftUI中更改actionSheet文本的颜色,但无法做到。我尝试了以下代码。
private var actionSheet: ActionSheet {
let button1 = ActionSheet.Button.default(Text("Week 1").foregroundColor(.orange)) {
self.selectedShuffleWeek = "Week 1"
self.shufflePresented = true
self.actionSheetPresented = false
}
let button2 = ActionSheet.Button.default(Text("Week 2").foregroundColor(Color("GreenColor"))) {
self.selectedShuffleWeek = "Week 2"
self.shufflePresented = true
self.actionSheetPresented = false
}
let button3 = ActionSheet.Button.default(Text("Week 3").foregroundColor(Color("GreenColor"))) {
self.selectedShuffleWeek = "Week 3"
self.shufflePresented = true
self.actionSheetPresented = false
}
let dismissButton = ActionSheet.Button.cancel {
self.selectedShuffleWeek = ""
self.actionSheetPresented = false
}
let buttons = [button1, button2, button3, dismissButton]
return ActionSheet(title: Text("Shuffle"),
buttons: buttons)
}
之后,我也尝试更改显示此操作表的视图的重点颜色,但没有成功。