Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cell's contentView contents duplicated. Cells not dequeuing or reusing correctly. #155

Open
viewDidAppear opened this issue Nov 6, 2012 · 3 comments

Comments

@viewDidAppear
Copy link

Driving me mad. I use the recommended Example (on the front page) for cellForItemAtIndexPath, and in my cell creation, I add a Label subview because I require text to be shown on the bottom of the cell.

Only problem is, when I scroll it will visibly stutter, and when I return, there are duplicates of the text (and assumably the image too) on every cell. Leaving the grid view slow, unresponsive and unpleasant to use. I really don't want to have to go find another one.

Any ideas?

@kolinkrewinkel
Copy link
Owner

This method will always return something, similar to the new UITableView method. If you add subview every time it's called, you'll get a million subviews. Add them only in your sub class's init method and set values on the properties "cell.textLabel.text = ..."

Sent from my iPhone

On Nov 6, 2012, at 4:04, cocotutch [email protected] wrote:

Driving me mad. I use the recommended Example (on the front page) for cellForItemAtIndexPath, and in my cell creation, I add a Label subview because I require text to be shown on the bottom of the cell.

Only problem is, when I scroll it will visibly stutter, and when I return, there are duplicates of the text on every cell. Leaving the grid view slow, unresponsive and unpleasant to use. I really don't want to have to go find another one.

Any ideas?


Reply to this email directly or view it on GitHub.

@viewDidAppear
Copy link
Author

So I have to subclass KKGridViewCell to set my imageView and textLabel properties?

@viewDidAppear
Copy link
Author

Setting the image should not call multiple times. The grid view should not be glitchy when you scroll by any means. I have tried to set up my cellForItemAtIndexPath: method like a normal UITableViewCell method, with "if(cell==nil)" conditionals, where I create any necessary subviews, and inside the else statement I grab the view by its tag.

Beneath the entire conditional, I set the property of the textLabel subview and the imageView that was already found upon the cell.

How can I possibly be going wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants