GMGridView icon indicating copy to clipboard operation
GMGridView copied to clipboard

Smooth scroll with UIImageView as subview of GridCellView

Open AndreaVitale opened this issue 12 years ago • 2 comments

Hi, i'm a problem with my application. I'm using your grid but i've problem if i insert an uiimageview as subview of grid cell. Here's my code:

  • (GMGridViewCell *)GMGridView:(GMGridView *)gridView cellForItemAtIndex:(NSInteger)index { GridAlbumItemView *gridAlbumItem = nil;

GMGridViewCell *cell = [gridView dequeueReusableCell];

if (!cell) cell = [[GMGridViewCell alloc] init];

UIImageView* imageView = [[UIImageView alloc] initWithFrame:cell.bounds]; [imageView setImage:[sourceArtworkArray objectAtIndex:index]]; //Artwork are cached into an array

cell.contentView = imageView;

return cell; }

All grid item contains album artwork of ipod library. I'm using ARC. Anyone can help me to improve scrolling?

AndreaVitale avatar Sep 02 '12 12:09 AndreaVitale

Your code looks not correct because you assign the image inside the cell creation part. That means the reused cell won't be assign the correct image.

bagusflyer avatar Sep 03 '12 13:09 bagusflyer

Any one to provide more details on this? I've the same queries here.

benroo avatar Mar 15 '13 05:03 benroo