RadListView on Android (NS 3.0.0, UI 2.0.1) - image not shown

Thread is closed for posting
2 posts, 0 answers
  1. Clarence
    Clarence avatar
    20 posts
    Member since:
    Nov 2016

    Posted 07 May 2017 Link to this post

    Found that RadListView on Android is not showing images within the list item template.

     

    Versions:

    • NativeScript 3.0.0
    • UI for NativeScript 2.0.1

     

    Steps to re-produce:

    • Clone the sample project I prepared (https://github.com/skywidesoft/ns-radlistview-test.git)
    • tns run ios --emulator (when run on iOS, the image was shown)
    • tns run android --emulator (when run on Android, the image was not shown)

     

    This problem not existing in older versions of NativeScript and UI for NativeScript.

     

    Kindly advice

    Regards

    Clarence

     

  2. Nikolay Iliev
    Admin
    Nikolay Iliev avatar
    351 posts

    Posted 08 May 2017 Link to this post

    Hello Clarence Ho,

    Thank for the detailed report and the ready for test sample application!
    After some investigation, we were able to find the reason for this issue and the reason is a bug introduced with NativeScript 3.0.0 related to the src property of ImageSource module. The bug is that the src property was only accepting string but not ImageSource as a value in an Android application.
    The good news is that this problem is already fixed and is currently in the master branch for NativeScript modules. The fix will be officially released with our incoming patch versions 3.0.1 which is expected within few days.

    Meanwhile, you can use one of the following solutions as a temporary workaround:

    Solution  1
    You can apply the fix using the next version of tns-core-modules.
    Steps needed to apply the next version
    rm -rf node_modules
    rm -rf platforms
    tns plugin add tns-core-modules@next
    npm install
    tns run android
    No changes in the code are required - the application will show the images in Android as well.

    Solution  2
    In your test application change the image_source property for Item class to accept a string (instead of ImageSource) and then in your item-service file and pass directly the URL as a string instead of ImageSource.

    Once again I am sorry for any inconvenience caused and I hope you will find the solutions provided applicable.

    Regards,
    Nikolay Iliev
    Telerik by Progress
    Did you know that you can open private support tickets which are reviewed and answered within 24h by the same team who built the components? This is available in our UI for NativeScript Pro + Support offering.
Back to Top