Using the following code:
var body: some View {
switch widgetFamily {
case .accessoryInline:
inlineAccessory
case .accessoryRectangular:
rectangularAccessory
case .systemLarge,.systemMedium:
homeScreenWidget
default:
EmptyView()
}
}
var rectangularAccessory: some View {
ViewThatFits {
VStack (alignment: .leading){
Text("\(entry.listVM.datedList.results.displayName)")
.font(.headline)
Text("#1: \(entry.listVM.datedList.results.books[0].title)")
.font(.body)
}
}
}
I get a lock screen widget with a gray background.
I have tried adding AccessoryWidgetBackground(), .backgoundStyle(.clear) and everything else I could think of, but I can never get rid of that gray background. I have changed the wallpaper and still it remains.
Any ideas?
remove WidgetBackground in StaticConfiguration
.background(Color("WidgetBackground")) <<<< remove