Xamarin Forms ListView Crashing while scrolling in android only.

AmolGaikwad.5908AmolGaikwad.5908 INUniversity ✭✭

Greeting,

I am developing the app using the xamarin forms.
We have ListView with ContextActions.

Below is listView Configuration

 <ListView x:Name="_ListView" RowHeight="140" CachingStrategy="RecycleElement" 
                IsPullToRefreshEnabled="true"
                RefreshCommand="{Binding LoadUpdatedDataCommand}"
                IsRefreshing="{Binding IsBusy, Mode=OneWay}"
                VerticalOptions="FillAndExpand" BackgroundColor="Transparent"
                SeparatorVisibility="Default" SeparatorColor="#898989"
                AutomationId = "idListView">
</ListView> 

here is context action menu

                 MenuItem btnAction = new MenuItem { Text = "titlw", Icon = "btn", IsDestructive = true };
                 btnAction.SetBinding(MenuItem.CommandParameterProperty, new Binding("."));
                 btnAction.AutomationId = "btn1";
                 btnAction.Clicked += Action_Clicked;
                ContextActions.Add(btnAction);

Steps To reproduce bug.

Tested Device Name : Samsung Note 2 (Android 4.4.2)

Step 1 : Long Press on cell. After that menu will get visible on top bar.
Step 2: Just Scroll ListView up & Down multiple times & app get crashed.

Appreciate your help. Thanks in advance.

Posts

  • AmolGaikwad.5908AmolGaikwad.5908 INUniversity ✭✭

    This appears to be a known bug with Forms when using RecycleElement: https://bugzilla.xamarin.com/show_bug.cgi?id=37513

    Xamarin team is aware of the issue. For now, the best workaround would be to have the ListView use RetainElement instead. However, Xamarin team Will keep looking into this to find out potential workaround.

    Thanks!

    Amol Gaikwad

Sign In or Register to comment.