Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Smooth scroll with UIImageView as subview of GridCellView #146

Open
AndreaVitale opened this Issue Sep 2, 2012 · 2 comments

Comments

Projects
None yet
3 participants

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.

benroo commented Mar 15, 2013

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

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