After rotating to landscape and then use scrollToObjectAtIndex, then use reloadData with new data source some wrong cells are shown #178

Closed
SergeyAniskin opened this Issue Feb 5, 2013 · 0 comments

Projects

None yet

1 participant

@SergeyAniskin

I found that the issue in subviews that is still added to rid view, to solve problem have to add code to remove GMGridViews from subviews

  • (void)reloadData
    {
    CGPoint previousContentOffset = self.contentOffset;

    [[self itemSubviews] enumerateObjectsUsingBlock:^(id obj, NSUInteger index, BOOL *stop)
    {
    if ([obj isKindOfClass:[GMGridViewCell class]])
    {
    [(UIView *)obj removeFromSuperview];
    [self queueReusableCell:(GMGridViewCell *)obj];
    }
    }];

    // Have to remove subviews because of bug
    for (UIView * v in [self subviews])
    {
    if ([v isKindOfClass:[GMGridViewCell class]])
    {
    [v removeFromSuperview];
    }
    }

...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment