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

Headers sometimes got sorted with items when add items repeatedly #2

Open
hubertwang opened this issue Jun 3, 2013 · 8 comments
Open

Comments

@hubertwang
Copy link

Hi,

I am recently using SMGridView in my project. I found that when I add items fast and continuously, sometimes header of the target section will be obtained by using dequeueReusableVIew. So it will looks like the header view move down and sort with the items in section.

Anyone got the same problem before? I am wondering if I was using it in a wrong way.

Hubert

@mcohnen
Copy link
Contributor

mcohnen commented Jun 3, 2013

Hi,

You can use - (UIView *)dequeReusableViewOfClass:(Class)clazz; to only get views that are from a specific class. Simply have your header and your cells be Views from different classes, and pass your cell view class to this method to only get cell items.

Let me know if it works!

@hubertwang
Copy link
Author

Hi,

I reviewed my codes and tried - (UIView *)dequeReusableViewOfClass:(Class)clazz. Unfortunately, it did not works.
I found that the problem is not from dequeueReusableView. I replaced them with dequeReusableViewOfClass but the header views still move down.

I just recalled that this problem did happen in the demo project, too. I took a snapshot below:
2013-06-03 9 50 55
It can be seen that section 0 is in the left midd part of the items.

@hubertwang
Copy link
Author

Oh, forgot to say, In the case, I clicks + button continuously and it happens.

@mcohnen
Copy link
Contributor

mcohnen commented Jun 3, 2013

Oh, so it might be an issue with repeatedly adding items to the GridView. I'll have a look at this.
I assume you found this issue when normally dealing with the GridView, or only when pressing + button repeated times?

@mcohnen
Copy link
Contributor

mcohnen commented Jun 3, 2013

There seems to be something broken with adding items due to some late commits. I'll fix it and let you know in this thread whenever it is ready.

@mcohnen
Copy link
Contributor

mcohnen commented Jun 3, 2013

I pushed a fix for a bug adding items. I'm not 100% sure this will fix the header issue when pressing + button repeatdly, but definitely there was an issue when adding items using animation.

Pull the latest from master and let me now if it works better

@hubertwang
Copy link
Author

Thanks! I'll test it later. By the way, will u update a new version on cocoa pods?

@hubertwang
Copy link
Author

img_0159
Seems that it's still happening..

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