Closed Tarekka closed 3 years ago
Well you should be doing something wrong. Maybe have a look to the sample which scroll smoothly with more than 20 different shadows displayed. Of course can't do anything without a repro. Also did you use the latest version ?
Same problem here. I am using just one shadow and the entire page takes 1-2 MINUTES to render.
I will provide more infos soon
Also, did you read : https://github.com/roubachof/Sharpnado.Shadows/blob/master/README.md#animating-shadows ?
@roubachof I think I was a little too hasty. atm I don't think shadows are causing my problems. It's more a forms 5 + AndroidX issue. i am still investigating
yup always start by removing shadows and see if the issue is still there x)
@roubachof for me there is no problem with shadows ;)
@roubachof , thanks for your response. I actually tried it in another one of my apps and it works perfectly. But in this app it takes time for some reason.
Any suggestions? I'm using the latest version by the way, and I'm not animating anything. Here's my example code:
App.xaml: `
<Setter Property="Shades">
<sh:ImmutableShades>
<sh:Shade BlurRadius="50"
Opacity="1"
Offset="-10,-10"
Color="#80FFFFFF" />
<sh:Shade BlurRadius="50"
Opacity="1"
Offset="6, 6"
Color="#33000000" />
</sh:ImmutableShades>
</Setter>
</Style>`
One of the cells from my test page: `...
sorry but:
You can either prerender your view then translate by the y axis when clicking the button. Or use the LazyView on the "common" page, and call Load on the LazyView when the page is loaded:
https://www.sharpnado.com/xamarin-forms-lazyview-boost-your-app-reactivity-and-startup-time/
In all case, it's not a performance issue with shadows but a question of architecture and layout timing.
Platform (please complete the following information):
Describe the bug Really bad performance when using shadows. I used one same immutable shadow defined in App.xaml resources, for 5 frames in a page, the UI freezes for ~4 seconds to load the page. iOS works perfectly. Even with only one shadow object, it hangs a little to load the page.
To Reproduce Steps to reproduce the behavior: