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
I have in my code a view collection that have each one image. When the user selects the collection cell I open a IDMPhotoBrowser and set its InitialPageIndex to match the selected cell.
This is the code I'm using to display the IDMPhotoBrowser
As you can see on the previous shots, it works fine to open a image. But when I try to drag the initial image to dismiss, I can see a second image in the background. This only happens on the InitialPageIndex image. If I drag from the initial image to any other, the new image presented will not have the "after image", but if I go back to the initial image it has the "after image"
Debugging the view hierarchy I found that the IDMPhotoBrowser has 2 IDMZoomingScrollView assigned to index 1 (or the selected index)
Found a solution, the problem happens because isViewLoaded returns YES and the PhotoBrowser assumes it is being presented.
I created a subclass and override the isViewLoaded because the vars _initalPageIndex and _currentPageIndex are internal and we can't alter them on a subclass.
This is a very dirty code and I will not put in production.
Just a quick help, if you make a public library like this you have to assume people want to customise the code to their needs. When you have the time, consider moving the variables that can change appearance (colors, fonts, sizes, etc) to the .h, you can still mark it as private and we can't change on your class, but we can change on subclasses we create.
I have in my code a view collection that have each one image. When the user selects the collection cell I open a
IDMPhotoBrowser
and set itsInitialPageIndex
to match the selected cell.This is the code I'm using to display the
IDMPhotoBrowser
As you can see on the previous shots, it works fine to open a image. But when I try to drag the initial image to dismiss, I can see a second image in the background. This only happens on the
InitialPageIndex
image. If I drag from the initial image to any other, the new image presented will not have the "after image", but if I go back to the initial image it has the "after image"Debugging the view hierarchy I found that the
IDMPhotoBrowser
has 2IDMZoomingScrollView
assigned to index 1 (or the selected index)One is created from:
And the other is from:
Inspecting even more I found that the method
isDisplayingPageForIndex:
return false if you set theInitialPageIndex
before the view is rendered.Can someone confirm this is intended? Because I don't want to make the view appear first to then change the image displayed.
I've tried to overload the
isDisplayingPageForIndex:
method, but I'm using swift and I could not find a way to do it.The text was updated successfully, but these errors were encountered: