Closed alancook closed 4 years ago
struct GridCell: View { var person: Person
var body: some View { NavigationLink( destination: Text("") ) { VStack() { Image(person.imageName) .resizable() .scaledToFit() .clipShape(Circle()) .shadow(color: .primary, radius: 5) .padding([.top, .leading, .trailing], 7) Text(person.firstName).lineLimit(1) Text(person.lastName).lineLimit(1) } .font(.headline).foregroundColor(.white) } } }
Another Apple bug it seems tried this with GridStack GItHib project with the same result.
Seem when you have a NavbigationLink you need to set the image to Render as Original this fixes the problem
struct GridCell: View { var person: Person
var body: some View { NavigationLink( destination: Text("") ) { VStack() { Image(person.imageName) .resizable() .scaledToFit() .clipShape(Circle()) .shadow(color: .primary, radius: 5) .padding([.top, .leading, .trailing], 7) Text(person.firstName).lineLimit(1) Text(person.lastName).lineLimit(1) } .font(.headline).foregroundColor(.white) } } }