Displaying a confirmationDialog in dark mode in an iPad simulator displays the dialog correctly using the system dark mode colours:
However, the same comfirmationDialog in dark mode on a physical device displays incorrectly using colours that make it difficult to read the title text (the image below actually makes the text clearer than it is on the device):
The iPad is running iPadOS 17.1.1 and the simulator is iOS 17.0.
The confirmationDialog is displayed correctly in light mode on both the simulator and real device.
The code to display the test confirmationDialog is:
struct ContentView: View {
@State private var isShowingDialog = false
var body: some View {
Button("Empty Trash") {
isShowingDialog = true
}
.confirmationDialog(
"Permanently erase the items in the Trash?",
isPresented: $isShowingDialog,
titleVisibility: .visible
) {
Button("Empty Trash", role: .destructive) {
// Handle empty trash action.
}
}
.buttonStyle(.borderedProminent)
}
}
Anyone have any ideas how I can work around this? I've tried using tint(color) in varous places to no effect. I really don't want to have to hand craft a confirmation dialog just for dark mode on the iPad.
Thanks.
Gavin