Sort by:
  • Home
  • Posts Tagged "Quick-Tips"

Tag: Quick-Tips

Load Images With Different Height In List Using Nativescript Image-Cache For Android/iOS

In this blog post, I am going to show a quick tip on how to show images with different height, downloaded from network, in nativescript list-view. Nativescript provides Image-Cache, to cache the downloaded image and fetch it from cache whenever requested next time. This image-cache is very useful in list-view kind of controls, where the list-item is re-created whenever the list-item comes back into visible area.

If you don’t know, how to use image-cache with list-view, I recommend you to check a very detailed tutorial by Peter-Staev on Using NativeScript’s ImageCache to cache images and display them in list like controls.

If the images that you want to show in list-view have different heights, Android will automatically update the image height once the image is downloaded and will update list-item’s height accordingly. But iOS will not resize the image height till we scroll the list and come back to that list-item.