Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugs in deletion #62

Open
ripplearc opened this issue Apr 23, 2013 · 0 comments
Open

bugs in deletion #62

ripplearc opened this issue Apr 23, 2013 · 0 comments

Comments

@ripplearc
Copy link

When delete a photo in the scrollview, and then scroll to the next one, you will find the photo is repeated in the next frame.
Reason:
The program thought the next frame is still valid so doesn't bother to reload:
if (NO == [currentPhotoView isKindOfClass:[KTPhotoView class]]) {
...
}

Solution:
Modify UnloadPhoto as follows

  • (void)unloadPhoto:(NSInteger)index removeOrReplace:(BOOL)remove;
    {
    if (index < 0 || index >= photoCount_) {
    return;
    }

    id currentPhotoView = [photoViews_ objectAtIndex:index];
    if ([currentPhotoView isKindOfClass:[KTPhotoView class]]) {
    [currentPhotoView removeFromSuperview];
    [photoViews_ replaceObjectAtIndex:index withObject:[NSNull null]];
    }

    if (remove) {
    [self unloadPhoto:index+1 removeOrReplace:FALSE];
    }
    }

The only case that removeOrReplace is true is when deletion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant