Open Nostordamus opened 4 years ago
This is happening because when resuming this code runs
which reverts the shadow settings from the platform specific
In onappearing if you toggle any of the platform specifics that should work around the issue for now
still happening. Need help.
The same thing is happening to us, we have a Behavior written on the Frame to adjust the shadow in iOS, However, if hide the Frame and show based on a binding condition the shadow effect gets reset to the default XF one.
Any fixes planned on this?
work around is to override SetupLayer and reapply your shadow settings
` public override void SetupLayer() { base.SetupLayer();
this.RenderShadow();
} `
Is there a plan to include this in the next release?
Description
I was following the "VisualElement Drop Shadows on iOS" tutorial to add shadow to a element. Everything works fine except when you minimize the app (home button click) wait few seconds then reopen it. The app is then resumed but the custom shadows that I added are replaced with default shadow.
The tutorial article url: https://docs.microsoft.com/en-us/xamarin/xamarin-forms/platform/ios/visualelement-drop-shadow
Steps to Reproduce
Add following reference to any ContentPage tag in Xamarin Forms Xaml file - xmlns:ios="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core"
Create Frame element and add following properties to it: ios:VisualElement.IsShadowEnabled="true" ios:VisualElement.ShadowColor="Purple" ios:VisualElement.ShadowOpacity="0.7" ios:VisualElement.ShadowRadius="12"
Minimize the app, the app is now in background wait 5 seconds and then resume the app.
Expected Behavior
Applied shadow to the Frame should be the same as on fresh app startup
Actual Behavior
Applied shadow get reset with the default Frame shadow
Basic Information
Screenshots
Before minimizing: After resuming: