Forum Xamarin.Forms

Xamarin Forms Carousel does not update view.

Hallo everybody. I'm writing code to manage and show a simple objects list with an image and a text. I've wrote a good code behind because all works fine. But I have doubts about the Carousel View. This because the issue is that my carousel does not update itself when image has loaded from a REST service. But the code works because an external ImageView displays correctly the image in binding mode. I've realized a video to explain what appens. Any idea?

https://dropbox.com/s/a6yg1o9wqo4io4k/Carousel.mov?dl=0

Answers

  • jezhjezh Member, Xamarin Team Xamurai

    You can try to use nuget Xamarin.FFImageLoading.Forms to load your images in Carousel,which is a library to load images quickly & easily on Xamarin.iOS, Xamarin.Android, Xamarin.Form.

    When we check the Features,we will find that

    Multiple image views using the same image source (url, path, resource) will use only one bitmap which is cached in memory (less memory usage).


    Xamarin forums are migrating to a new home on Microsoft Q&A!
    We invite you to post new questions in the Xamarin forums’ new home on Microsoft Q&A!
    For more information, please refer to this sticky post.

  • GiulianoCandrevaGiulianoCandreva ITMember ✭✭
    I will. Thanks for your reply
  • jezhjezh Member, Xamarin Team Xamurai

    Waitting for your good news! :)

  • GiulianoCandrevaGiulianoCandreva ITMember ✭✭
    edited February 22

    ...no it does not work! :neutral: It's like the ObservableCollection didn't notify the loading of image on RecentItemChangedCommand... It's my idea of lazy loading:
    1) I download the entire object list from a a rest service without image (that are stored on db as byte array
    2) On RecentItemChangedCommand I call my method to download only the single image and the effect is what you can see on my video...

  • jezhjezh Member, Xamarin Team Xamurai

    Could you please post a basic demo to github or onedriver so that we can test on our side?

  • GiulianoCandrevaGiulianoCandreva ITMember ✭✭

    It would be a pleasure... Give me the time to prepare it. Thank you in advance for your time

  • GiulianoCandrevaGiulianoCandreva ITMember ✭✭
  • jezhjezh Member, Xamarin Team Xamurai
    edited 6:28AM

    On RecentItemChangedCommand I call my method to download only the single image

    I tested your code, and it took a long time to load the first two images. So ,I wonder if your images are big and therefore takes longer to load. So,when you switch between images, you switch to the next image before the first one is loaded.

    You can recheck it.

    Hope it can help you.

Sign In or Register to comment.