Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.
This repository was archived by the owner on May 1, 2024. It is now read-only.

[Enhancement] Drop shadow support for iOS/UWP #1707

@jassmith

Description

@jassmith

Rational

Drop shadows are fun, but rather platform specific in look/feel.

API

Drop shadows in Android unfortunately are implemented via Elevation which causes other changes with regards to z-order and does not provide a consistent mechanism for creating a well defined shadow. Unfortunately this makes Android an ungraceful target at best for this feature.

For iOS:

View.On<iOS>.SetShadowColor (Color color);
View.On<iOS>.SetShadowRadius (double radius);
View.On<iOS>.SetShadowOffset (Size offset);
View.On<iOS>.SetShadowOpacity (double opacity);

for UWP:

Layout.On<Windows>.SetShadowColor (Color color);
Layout.On<Windows>.SetShadowRadius (double radius);
Layout.On<Windows>.SetShadowOffset (Size offset);
Layout.On<Windows>.SetShadowOpacity (double opacity);

Expected Result

Setting the drop shadow on a view in iOS should cause that view to have a drop shadow. Setting the draw shadow on a layout in UWP should cause every view in that layout to have a drop shadow.

Ideally both sets of properties would operate on views, but UWP seems to prefer to perform these effects at the panel level.

Implementation details

Android

No change

iOS

Should be straightforward setting of CALayer properties.

UWP

https://docs.microsoft.com/en-us/windows/uwpcommunitytoolkit/controls/dropshadowpanel

We will not want to use the dropshadowpanel itself, just the techniques it uses to produce the effect.

Implications for CSS

While these properties are relevant to css, I think they should remain unsupported until a general support option can be added for all platforms.

Backward Compatibility

The renderers on each platform should check BindableObject.GetIsDefault(); the behavior of the renderers should only be altered if the BindableProperty has been explicitly set. This should provide backward compatibility.

Difficulty : Easy

No obvious implementation issues stick out to me.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions