You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We've recently upgraded our pod from a very old version to the latest and have run into an issue displaying animated gifs using PINAnimatedImageView that we were not experiencing when the library depended on FLAnimatedImageView. Specifically, setting PINAnimatedImageView.animatedImageView doesn't give the view an intrinsic frame size the way setting .image does. This is an important behavior when implementing a photo viewer that uses PINAnimatedImageView inside of a zoomable scroll view.
I've perused a lot of sample code for implementing a zoomable photo viewer, and they all seem rely on the ImageView's frame to perform layout updates when zooming, just like ours does, so I don't think we're doing anything particularly weird.
Code (or even better whole projects) which reproduce the issue.
This is a project that contains a barebones implementation of our production photo viewer (minus all kinds of bells and whistles and transition animations etc), along with static assets for displaying in it as well as remote images to be downloaded and displayed. You'll find that the images work as expected, but the gifs do not display in the viewer. (Simply tap the image to close the viewer)
I've found a workaround that behaves adequately: setting the ImageView's image to the animationImage.coverImage appears to supply the frame information required for the rest of the layout and zooming logic to work. You'll find 3 small pieces of commented-out code in PhotoViewerViewController.swift that will fix the behavior of the viewer.
I'm happy to provide more information, take feedback about anything weird our photo viewer is doing that it shouldn't be, or field other suggestions for working around this behavior. Cheers.
The text was updated successfully, but these errors were encountered:
We've recently upgraded our pod from a very old version to the latest and have run into an issue displaying animated gifs using
PINAnimatedImageView
that we were not experiencing when the library depended onFLAnimatedImageView
. Specifically, settingPINAnimatedImageView.animatedImageView
doesn't give the view an intrinsic frame size the way setting.image
does. This is an important behavior when implementing a photo viewer that uses PINAnimatedImageView inside of a zoomable scroll view.I've perused a lot of sample code for implementing a zoomable photo viewer, and they all seem rely on the ImageView's
frame
to perform layout updates when zooming, just like ours does, so I don't think we're doing anything particularly weird.Version of the project you're using.
Latest cocoapods release
Code (or even better whole projects) which reproduce the issue.
This is a project that contains a barebones implementation of our production photo viewer (minus all kinds of bells and whistles and transition animations etc), along with static assets for displaying in it as well as remote images to be downloaded and displayed. You'll find that the images work as expected, but the gifs do not display in the viewer. (Simply tap the image to close the viewer)
I've found a workaround that behaves adequately: setting the ImageView's
image
to theanimationImage.coverImage
appears to supply the frame information required for the rest of the layout and zooming logic to work. You'll find 3 small pieces of commented-out code inPhotoViewerViewController.swift
that will fix the behavior of the viewer.PINGifSampleZip.zip
Steps which reproduce the issue.
See project description above.
I'm happy to provide more information, take feedback about anything weird our photo viewer is doing that it shouldn't be, or field other suggestions for working around this behavior. Cheers.
The text was updated successfully, but these errors were encountered: