When using swipeview to swipe navigate to another page, if I remove or pop a page from the stack, the app always crashes with the same error.
Page 2 is displayed and page 1 was popped out of the navigation stack with no errors.
Throws error: "System.NullReferenceException: Object reference not set to an instance of an object"
SwipeViewRenderer.UpdateIsOpen (System.Boolean isOpen)
SwipeViewRenderer.DisposeSwipeItems ()
SwipeViewRenderer.<ResetSwipe>b__71_0 ()
Runnable.Run ()
IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this)
(wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.47(intptr,intptr)
Visual Studio 2019
Xamarin.Forms v4.6
I experienced the same bug when deleting the item in the list while the SwipeView is open and are animating back to closed.
One work around until #10682 is merged is to set : SwipeBehaviorOnInvoked="RemainOpen"
for the SwipeItems
.
The fix on this PR https://github.com/xamarin/Xamarin.Forms/pull/10827/commits/3a2826c6350d1a05c9cbc1e4c9d9537a40d208fd was already merged into main
branch, however it was not merged into 4.7.0
branch yet.
Waiting for the xamarin team @samhouts @davidortinau @rmarinho @pauldipietro @jsuarezruiz to release it into the next stable release.
Just submitted the same fix for iOS https://github.com/xamarin/Xamarin.Forms/pull/11292
Most helpful comment
I experienced the same bug when deleting the item in the list while the SwipeView is open and are animating back to closed.
One work around until #10682 is merged is to set :
SwipeBehaviorOnInvoked="RemainOpen"
for theSwipeItems
.