Canvatorium Visio Lab 5004
Shadow + Hover Effect.
Exploring what SwiftUI has to offer to add depth to 2D views in visionOS. The order of these modifiers is important. I used this order: hoverEffect > cornerRadius > shadow
struct Lab5004: View {
var body: some View {
ZStack {
Rectangle()
.foregroundStyle(.blue)
.hoverEffect(.automatic, isEnabled: true)
.cornerRadius(24)
.shadow(radius: 20)
Text("Shadow + Hover Effect")
.font(.title)
}
.padding(100)
}
}