Text shadow in Widget SwiftUI not working

Viewed 699

I am using this in a widget view and it works fine without the last .shadow() line. But adding the shadow won't work. The preview is just erroring out, but giving no particular error.

What am I doing wrong here? The .shadow() works fine using it in the "Hello World" text of the main app.

Text("Some dummy text")
    .foregroundColor(Color("myorange"))
    .font(.subheadline)
    .fontWeight(.medium)
    .lineLimit(2)
    .truncationMode(.tail)
    .shadow(color: .green, radius: 3, x: 1, y: 1)
0 Answers
Related