PeterStaev / nativescript-image-swipe

A NativeScript widget to easily :point_up_2: and :mag: through a list of images
Apache License 2.0
35 stars 21 forks source link

iOS: When app goes to background then to foreground, image does not display #28

Open davecoffin opened 6 years ago

davecoffin commented 6 years ago

View a photo in the gallery, then go to the homescreen. Then go back to the app. The photo you were viewing does not display. If you swipe over, the next one displays and everything works as normal. In onresume, probably something needs to happen to display the photo.

rondey commented 5 years ago

I had a similar problem with the RadListView. The solution was call the RadListView function "refresh" inside the callback of resumeEvent

joralegre commented 4 years ago

View a photo in the gallery, then go to the homescreen. Then go back to the app. The photo you were viewing does not display. If you swipe over, the next one displays and everything works as normal. In onresume, probably something needs to happen to display the photo.

Detect "on resume event" and refresh(); Ex: const applicationModule = require("tns-core-modules/application");

function pageLoaded(args) { var page = args.object; ... ...... your code ........... ... //Detect Refresh resumeListener = (args) => { console.log("The appication was resumed!"); //refresh your gallery page.getViewById("gallery").refresh(); }; applicationModule.on(applicationModule.resumeEvent, resumeListener); }