How can I set the shadow offset in graphicsLayer? The top shadow of components at the bottom of the screen is almost invisible. I want to fix the shadow offset.
s
Sergey Y.
08/13/2025, 2:46 PM
Short answer: you can’t.
Elevation has some limitations, it uses a
fixed-position spot light source
, positioned above the center of the screen, and changing it requires private APIs. In general, use the new shadow API modifiers(
I haven’t used them much, but I reviewed the implementation. It’s pretty good, it has a caching system, uses brushes and the canvas efficiently, and nothing caught my attention that might cause performance issues.
👍 1
k
Kyant
08/13/2025, 5:01 PM
Thanks, it works perfectly!
❤️ 3
t
Tgo1014
08/14/2025, 7:41 AM
This article have some very cool graphics of how each component is positioned on top of each other. Really cool.