nativescript-photoviewer icon indicating copy to clipboard operation
nativescript-photoviewer copied to clipboard

Slow loading time on iOS with NativeScript 4.0.0

Open NickIliev opened this issue 6 years ago • 6 comments

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:

Tested on iPhone X with iOS 11.3

NickIliev avatar Apr 23 '18 08:04 NickIliev

I am facing the same issue, any fix known?

AradhanaR avatar Jun 26 '18 11:06 AradhanaR

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.

manijak avatar Jun 26 '18 18:06 manijak

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 avatar Feb 01 '19 03:02 chrisbekas

@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.

manijak avatar Apr 08 '19 21:04 manijak

Since this is not fixed anymore and the repo seems unmaintained, can you please suggest a valid alternative?

mircobabini avatar Aug 19 '20 06:08 mircobabini

@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.

manijak avatar Aug 19 '20 06:08 manijak