To set up iOS 18 widget tint mode without any modifications, follow the steps below.
I hope this helps many people.
You just need to add one line.
.containerBackgroundRemovable(false)
ex)
struct create_view: Widget {
let kind: String = "CalendarWidget"
var body: some WidgetConfiguration {
StaticConfiguration(kind: kind, provider: Provider()) { entry in
calendar_widgetEntryView(entry: entry)
}
.supportedFamilies([.systemLarge])
.containerBackgroundRemovable(false)
.contentMarginsDisabledIfAvailable()
}
}
Before:
After :