nativescript-image-swipe icon indicating copy to clipboard operation
nativescript-image-swipe copied to clipboard

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

Open davecoffin opened this issue 6 years ago • 2 comments

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.

davecoffin avatar Aug 09 '18 12:08 davecoffin

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

rondey avatar Jun 17 '19 09:06 rondey

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); }

joralegre avatar Sep 29 '19 22:09 joralegre