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

[Bug] Cannot change shadow appearance on Frame from version 4.5.x #10348

Closed
badstorm opened this issue Apr 16, 2020 · 2 comments · Fixed by #10469
Closed

[Bug] Cannot change shadow appearance on Frame from version 4.5.x #10348

badstorm opened this issue Apr 16, 2020 · 2 comments · Fixed by #10469
Assignees
Labels
4.5.0 regression on 4.5.0 a/customrenderer a/frame e/2 🕑 2 i/regression in-progress This issue has an associated pull request that may resolve it! p/iOS 🍎 t/bug 🐛
Milestone

Comments

@badstorm
Copy link

badstorm commented Apr 16, 2020

Description

In my custom render I have this settings for change the appearance of the shadow in iOS

protected override void OnElementChanged(ElementChangedEventArgs<Frame> e)
{
    base.OnElementChanged(e);
    Layer.ShadowRadius = 10f;
    Layer.ShadowColor = UIColor.Black.CGColor;
    Layer.ShadowOffset = new CGSize(0,10);
    Layer.ShadowOpacity = 0.16f;
}

but from Xamarin Forms 4.5.x not works anymore.

What I see is that in the FrameRenderer was added a new ShadowView that in not accessible from the custom renderer.

Workaround

In The FrameRender add a public function like this for access the ShadowView::

public ShadowView InnerShadowView
{
   get => _shadowView;
}

So in the custom renderer I can do:

protected override void OnElementChanged(ElementChangedEventArgs<Frame> e)
{
    base.OnElementChanged(e);
    InnerShadowView.Layer.ShadowRadius = 10f;
    InnerShadowView.Layer.ShadowColor = UIColor.Black.CGColor;
    InnerShadowView.Layer.ShadowOffset = new CGSize(0,10);
    InnerShadowView.Layer.ShadowOpacity = 0.16f;
}
@badstorm badstorm added s/unverified New report that has yet to be verified t/bug 🐛 labels Apr 16, 2020
@pauldipietro pauldipietro added this to New in Triage Apr 16, 2020
@samhouts
Copy link
Member

related to #7518

@samhouts samhouts added e/2 🕑 2 and removed s/unverified New report that has yet to be verified labels Apr 17, 2020
@samhouts samhouts added this to the 4.5.0 milestone Apr 17, 2020
@samhouts samhouts added this to To do in v4.5.0 Apr 17, 2020
@samhouts samhouts moved this from New to Ready For Work in Triage Apr 17, 2020
@samhouts samhouts added this to To do in iOS Ready For Work Apr 23, 2020
@samhouts samhouts removed this from Ready For Work in Triage Apr 23, 2020
@samhouts samhouts added this to To do in Sprint 169 Apr 23, 2020
@samhouts samhouts added the in-progress This issue has an associated pull request that may resolve it! label Apr 27, 2020
@jfversluis
Copy link
Member

Added reproduction here (note; uses a local nupkg file so will probably fail to restore that) and tried with the NuGet resulting from #10469. Works as expected.

With the fix from the afore mentioned PR it is likely that all renderers should work as before.

Repro10348.zip

@samhouts samhouts moved this from To do to Continued in next sprint in Sprint 169 May 5, 2020
@samhouts samhouts added this to To do in Sprint 170 via automation May 5, 2020
@samhouts samhouts moved this from To do to In progress in Sprint 170 May 6, 2020
@samhouts samhouts moved this from To do to In progress in iOS Ready For Work May 6, 2020
@samhouts samhouts moved this from In progress to Ready for Review (Issues) in Sprint 170 May 7, 2020
@samhouts samhouts moved this from Ready for Review (Issues) to In progress in Sprint 170 May 7, 2020
@rmarinho rmarinho linked a pull request Jun 2, 2020 that will close this issue
2 tasks
@samhouts samhouts moved this from To do to Done in v4.5.0 Jun 2, 2020
@samhouts samhouts removed this from Done in v4.6.0 Jul 29, 2020
@samhouts samhouts added this to In Progress in v4.6.0 Jul 29, 2020
@samhouts samhouts moved this from In Progress to Done in v4.6.0 Jul 29, 2020
@samhouts samhouts removed this from Done in v4.6.0 Jul 29, 2020
@samhouts samhouts added this to In Progress in v4.6.0 Jul 29, 2020
@samhouts samhouts moved this from In Progress to Done in v4.6.0 Jul 29, 2020
@samhouts samhouts removed this from Done in v4.6.0 Jul 29, 2020
@samhouts samhouts added this to In Progress in v4.6.0 Jul 29, 2020
@samhouts samhouts moved this from In Progress to Done in v4.6.0 Jul 29, 2020
@samhouts samhouts removed this from Done in v4.6.0 Jul 29, 2020
@samhouts samhouts added this to In Progress in v4.6.0 Jul 29, 2020
@samhouts samhouts moved this from In Progress to Done in v4.6.0 Jul 29, 2020
@samhouts samhouts removed this from Done in v4.6.0 Jul 29, 2020
@samhouts samhouts added this to In Progress in v4.6.0 Jul 29, 2020
@samhouts samhouts moved this from In Progress to Done in v4.6.0 Jul 29, 2020
@samhouts samhouts removed this from Done in v4.6.0 Jul 29, 2020
@samhouts samhouts added this to In Progress in v4.6.0 Jul 29, 2020
@samhouts samhouts moved this from In Progress to Done in v4.6.0 Jul 29, 2020
@samhouts samhouts removed this from Done in v4.6.0 Jul 29, 2020
@samhouts samhouts added this to In Progress in v4.6.0 Jul 29, 2020
@samhouts samhouts moved this from In Progress to Done in v4.6.0 Jul 29, 2020
@samhouts samhouts removed this from Done in v4.6.0 Jul 29, 2020
@samhouts samhouts added this to In Progress in v4.6.0 Jul 29, 2020
@samhouts samhouts moved this from In Progress to Done in v4.6.0 Jul 29, 2020
@samhouts samhouts removed this from Done in v4.6.0 Jul 29, 2020
@samhouts samhouts added this to In Progress in v4.6.0 Jul 29, 2020
@samhouts samhouts moved this from In Progress to Done in v4.6.0 Jul 29, 2020
@samhouts samhouts removed this from Done in v4.6.0 Jul 29, 2020
@samhouts samhouts added this to In Progress in v4.6.0 Jul 30, 2020
@samhouts samhouts moved this from In Progress to Done in v4.6.0 Jul 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
4.5.0 regression on 4.5.0 a/customrenderer a/frame e/2 🕑 2 i/regression in-progress This issue has an associated pull request that may resolve it! p/iOS 🍎 t/bug 🐛
Projects
No open projects
Sprint 169
  
Continued in next sprint
Sprint 170
  
Continued in next sprint
v4.5.0
  
Done
v4.6.0
  
Done
Development

Successfully merging a pull request may close this issue.

3 participants