Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8639353
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T10:58:47+00:00 2026-06-12T10:58:47+00:00

I have a list of countries in a tableview (about 100 rows). If I

  • 0

I have a list of countries in a tableview (about 100 rows). If I scroll through it at a slow pace, everything works fine and the correct images are loaded. If I scroll through as fast as I can, then some of the country flags gets mixed up. It seems like a bug in the ImageLoader but I find it strange that nobody else has encountered it? I am using the latest code from here:
https://github.com/migueldeicaza/MonoTouch.Dialog/blob/master/MonoTouch.Dialog/Utilities/ImageLoader.cs

If I change the “MaxRequests” in ImageLoader.cs to a much larger value like 30 everything seems to work. If I change it down to 3 everything loads very slowly and it shows a lot of wrong country flags.

Is there something wrong with the way I use this class? I tried going the subclass way like here:
https://github.com/xamarin/mobile-samples/blob/master/MWC/MWC.iOS/UI/CustomElements/SpeakerCell.cs

but I got exactly the same problem. Worked fine when scrolling slowly, and got confused when scrolling fast.

I load the image like this:

private System.Collections.Generic.Dictionary<string, List<NSIndexPath>> listOfImageUrls = new System.Collections.Generic.Dictionary<string, List<NSIndexPath>>();

public void UpdatedImage (Uri uri)
{
    InvokeOnMainThread (() => ReloadImage(uri));
}

public void ReloadImage(Uri uri){
    String id = uri.ToString();
    if(!listOfImageUrls.ContainsKey(id))
        return;
    List<NSIndexPath> indexes = listOfImageUrls[id];
   _tvc.GetTableView().ReloadRows(indexes.ToArray(), UITableViewRowAnimation.None);
}

public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
{
 ...
   UIImageView imgLogo = ...; 
   string imageUri = getCountryFlagUrlSmall (dataSourceItemCountry);
   imgLogo.Image = MonoTouch.Dialog.Utilities.ImageLoader.DefaultRequestImage (new Uri (imageUri), this);           

   if(listOfImageUrls.ContainsKey(imageUri))
   {
      if(!listOfImageUrls[imageUri].Contains(indexPath))
        listOfImageUrls[imageUri].Add(indexPath);                       
   }
   else
    listOfImageUrls.Add(imageUri, new List<NSIndexPath>{indexPath});
   } 
...
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T10:58:49+00:00Added an answer on June 12, 2026 at 10:58 am

    I changed over to use this one:
    https://github.com/sichy/UrlImageStore/blob/master/MonoTouch.UrlImageStore/UrlImageStore.cs

    Required only 4-5 lines of code to change implementation and everything loads correctly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have one AJAX function which return the list of countries. It works fine.
I have published an app in market, checked the device list, countries list everything
I have a list of countries in this format in an external file: <?
I have a list called Countries, and each country has a list of Towns,
I have a list of calling codes for all countries(the phone number prefixes), I
I have this drop-down list of countries: <select name=country> <option value=>Country...</option> <option value=Afganistan>Afghanistan</option> <option
I have an app where I need to get the list of countries,languages etc
I have a list of countries, html, they have numeric ids and country name:
hi i have an list of countries on table so i am sorting with
I have a list of data where I keep e.g. countries with code, name

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.