nativescript-photoviewer
nativescript-photoviewer copied to clipboard
Slow loading time on iOS with NativeScript 4.0.0
I am using this basic test project and on iOS emulator and device the loading time for a gallery with 4 images is approximately 10-15 seconds and during this time the UI is completely blocked.
Steps to reproduce:
- use this app
- tap the button to load the images
Tested on iPhone X with iOS 11.3
I am facing the same issue, any fix known?
Sorry, thought I replied to this issue. This has nothing to do with TNS 4.x, I've seen this issue for a while after updating the NYTPhotoViewer
pod to the latest version.
The issue is due to the images being too large, your example has quite large images, 2mb+ in size. Images I show in my apps are small in size, so the loading is fast enough. But sometimes there can be many of them, so it still hangs.
That is why I added the completitionCallback
property in the plugin. This function is called when the gallery is shown (loaded). So one can show a spinner when opening the gallery, then hide it when the callback is hit. That is the only workaround I have for the moment.
Don't know yet if this is a issue with the Pod or the way I initialise it in the plugin. I see that the pod is not maintained anymore... will try and find an alternative.
What's the recommended way to show a spinner when loading the album? I've tried a whole bunch of different plugins but the UI is blocked and the spinner doesn't show. Any suggestions?
@chrisbekas you can take a look at the demo apps I've added. It works fine on vanilla tns apps, but on angular the gui and spinner still hang. have not figured out why that is.
Since this is not fixed anymore and the repo seems unmaintained, can you please suggest a valid alternative?
@mircobabini Yeah I don't think there will be any new updates or features in this repo.
My recommendation would be to combine following plugins to create a gallery:
- nativescript-carousel: https://github.com/manijak/nativescript-carousel
- nativescript-image-zoom (or any other image plugin of your choice)
- Modal view in you app
This way you will have complete control of the components and will be able to create similar, if not better, looking gallery. I did this on Android for my app, and it works great.