GetCell called continuously after all the rows are populated

F1FreakF1Freak USMember ✭✭

I am using UISearchController along with UITableView. After all my rows are populated GetCell is called continuously. It keeps populating those rows which are not visible inside my View and can be seen after being scrolled.

Before I scroll the View it keeps calling GetCell in the background.

What could be the issue?

I am using DequeueReusableCell inside my GetCell method.

UITableViewCell cell = this.myListView.DequeueReusableCell("cellIdentifier") as UITableViewCell;

Tagged:

Answers

  • ColeXColeX Member, Xamarin Team Xamurai

    You mean the method was called continuously ,never stop ?

  • F1FreakF1Freak USMember ✭✭
    edited July 15

    @ColeX Yes, It loads all the elements which are visible in the UI and the rest elements which are pending to be shown (which can't be seen) are loaded in the background in a loop.

    Example - I have 10 elements, of which 7 are visible on the UI and the rest 3 are not shown. When the 7 elements are loaded and the rest 3 are also loaded(but not shown), and they keeping getting called continuously in a loop.

    Please note I haven't scrolled yet.

  • ColeXColeX Member, Xamarin Team Xamurai

    Search in your project to check if keep calling tableview.ReloadData() at somewhere.

  • F1FreakF1Freak USMember ✭✭
    edited July 16

    I removed tableview.ReloadData(), still its creating the same issue. I problem occurs when I load all the elements. Just one more update, this issue happens when I run an automation test script and does not occur during manual process.

  • ColeXColeX Member, Xamarin Team Xamurai

    Could you post the code in GetCell method?

  • F1FreakF1Freak USMember ✭✭
    edited July 16

    --

  • ColeXColeX Member, Xamarin Team Xamurai

    Your code looks no problem at all , consider raise issue here for better help.

Sign In or Register to comment.