-
Notifications
You must be signed in to change notification settings - Fork 116
Description
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.