nativescript-image-swipe
nativescript-image-swipe copied to clipboard
iOS: When app goes to background then to foreground, image does not display
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.
I had a similar problem with the RadListView. The solution was call the RadListView function "refresh" inside the callback of resumeEvent
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); }