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
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: