Can AGSFeatureLayer and AGSGraphicsOverlay automatically adapt to Dark Mode (interface style trait) changes?

517
1
10-18-2019 11:41 AM
AndrewLeung
New Contributor II

I defined dark variants for all UIColor objects used in symbols for the feature layers and graphic overlays. While it loads the correct variant initially, it doesn't automatically adapt when I toggle Dark Mode.

Do I have to listen for interface style changes and manually re-set symbols in all the layers and overlays? Or is there a way to ask them to re-render?

0 Kudos
1 Reply
Nicholas-Furness
Esri Regular Contributor

Yes, you would have to modify the symbols. This can be made easier by using renderers (I get the impression you're already doing that), but it would still be something you'd have to code.

If you update the renderers on the layers and overlays (or individual symbols on individual graphics) then Runtime will note the change(s) and re-render as needed.

The reason why it's this way is a side-effect of having a shared Runtime Core across all platforms. It relegates UIColor to a convenient type for the iOS SDK, but internally Runtime doesn't hold on to a UIColor and so we don't get the benefit of dynamic asset colors in this way.

0 Kudos