-
-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pancake view crashes app on dynamic app theme switch: PancakeViewRenderer Cannot access a disposed object #168
Comments
Hi, Do you have a fix for this yet? It crashes the app. 07-29 17:58:30.377 D/Mono ( 6330): GC_TAR_BRIDGE bridges 961 objects 64690 opaque 26667 colors 961 colors-bridged 961 colors-visible 961 xref 1 cache-hit 0 cache-semihit 0 cache-miss 0 setup 0.23ms tarjan 69.09ms scc-setup 0.41ms gather-xref 0.05ms xref-setup 0.01ms cleanup 4.56ms |
Hello,
When i removed the ScrollView No Bug Appears |
Same here... please notify me when there is a fix. Thank you!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
I figured this one out. I couldn't use @sthewissen's original project because of the scope and complexity. The shared views require compliance with all current versions of various platforms. But they haven't been updated, so the source can't be modified except by Steven himself. Perhaps he'll read this and consider making this small change to his own code, plus updating everything. I jumped over to the (Rounded Content View)[https://github.com/tomh4/HotTotem.RoundedContentView] here on GitHub because it was similar to the PancaeView, except without the internal gradients. I was both surprised and refreshed that this older library reported the same error as we had all seen: "cannot access a disposed object". But because the library was small, I was able to download the source, including the renderers, and do some active testing. The problem popped up right away: ``
The solution is in my own Modern App Demo ``
The error goes away instantly. Steps:(1) Copy the RoundedContentView class into your project from my UI.XamForms Support Library (2) Copy the Android renderer as is (3) Copy my modified iOS renderer as well. |
Hello everyone has anyone found a solution to this? I'm getting this error trying to set BackgroundColor dynamically using Pancakeview.
|
Hi, I'm facing same issue, it works in iOS but in android app getting crash when I tried to switch another Tabs System.ObjectDisposedException Is there any fix for this issue? |
I solved this by jumping over to another component, the RoundedContentView. If you really need the PancakeView, you will have to absorb all of the project's code and revise both renderers. The problem is that the renderer(s) are dying while still attached to the handlers -- see this part of the code sample: // CRITICAL: Check the Element for null Unfortunately, the PancakeView is an elaborate project with many shard libraries that you will find difficult to set up properly. That's why I dropped it. Best of luck. |
I've recently started to use a dynamic theme for a Xamarin.Forms app with
AppThemeBinding
. Unfortunately, the Pancake view crashes sometimes after first, other times after several theme switches via the system menu. I can reliably reproduce it in my Xamarin.Forms Android app. The UI is as simple as below:<pancakeview:PancakeView BackgroundColor="{AppThemeBinding Dark={StaticResource TileBackground_Dark}, Light={StaticResource TileBackground_Light}}"> ...
The crash points to
Android.Views.View.SetBackgroundColor
inPancakeViewRenderer
. I'm changing the theme via the context system menu (pulled from the top of the screen):As you can see, there is no custom code in the stack trace, only the
PancakeViewRenderer
.How can I fix the issue?
The text was updated successfully, but these errors were encountered: