GMGridView
GMGridView copied to clipboard
Smooth scroll with UIImageView as subview of GridCellView
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?
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.
Any one to provide more details on this? I've the same queries here.