How can I dynamically change the cellsize in AQGridView and have the change animate #170

Open
artangco opened this Issue Oct 7, 2012 · 4 comments

Comments

Projects
None yet
2 participants
@artangco

artangco commented Oct 7, 2012

This is not an issue but I couldn't find a forum to post this to. If this is not the place for it please direct me to a location I should be posting such a question.

I'm trying to change the cellsize for an AQGridView dynamically and would like the change to animate in the gridview. Is that possible and if so how should I approach it.

The idea is that the gridview overall size doesn't change but the cellsize within changes and the items rearrange themselves to accomodate the new size.

I assume I do something between these two calls but I'm not sure what I can change to make this work.

[self.gridView beginUpdates];
....
[self.gridView endUpdates];

@evadne

This comment has been minimized.

Show comment Hide comment
@evadne

evadne Oct 7, 2012

Collaborator

Try using UIView animations. Not sure if the cells are all reloaded during
grid view reload. Worst case, custom animations will be needed.

On Oct 7, 2012, at 12:24, artangco notifications@github.com wrote:

This is not an issue but I couldn't find a forum to post this to. If this
is not the place for it please direct me to a location I should be posting
such a question.

I'm trying to change the cellsize for an AQGridView dynamically and would
like the change to animate in the gridview. Is that possible and if so how
should I approach it.

The idea is that the gridview overall size doesn't change but the cellsize
within changes and the items rearrange themselves to accomodate the new
size.

I assume I do something between these two calls but I'm not sure what I can
change to make this work.

[self.gridView beginUpdates];
....
[self.gridView endUpdates];


Reply to this email directly or view it on
GitHubhttps://github.com/AlanQuatermain/AQGridView/issues/170.

Collaborator

evadne commented Oct 7, 2012

Try using UIView animations. Not sure if the cells are all reloaded during
grid view reload. Worst case, custom animations will be needed.

On Oct 7, 2012, at 12:24, artangco notifications@github.com wrote:

This is not an issue but I couldn't find a forum to post this to. If this
is not the place for it please direct me to a location I should be posting
such a question.

I'm trying to change the cellsize for an AQGridView dynamically and would
like the change to animate in the gridview. Is that possible and if so how
should I approach it.

The idea is that the gridview overall size doesn't change but the cellsize
within changes and the items rearrange themselves to accomodate the new
size.

I assume I do something between these two calls but I'm not sure what I can
change to make this work.

[self.gridView beginUpdates];
....
[self.gridView endUpdates];


Reply to this email directly or view it on
GitHubhttps://github.com/AlanQuatermain/AQGridView/issues/170.

@artangco

This comment has been minimized.

Show comment Hide comment
@artangco

artangco Oct 7, 2012

Thanks for the response. Actually putting aside the animation part how can I change the cellsize dynamically. I'm not sure what variable I need to modify to make the cellsize change. gridview has a cellHeight and cellWidth but they are not assignable.

artangco commented Oct 7, 2012

Thanks for the response. Actually putting aside the animation part how can I change the cellsize dynamically. I'm not sure what variable I need to modify to make the cellsize change. gridview has a cellHeight and cellWidth but they are not assignable.

@evadne

This comment has been minimized.

Show comment Hide comment
@evadne

evadne Oct 7, 2012

Collaborator

Can you do some magic so your delegate returns a different cell size
(portrait size for cell), and invoke that magic right before a reloadData
call, all wrapped in an animation block?

On Oct 7, 2012, at 13:05, artangco notifications@github.com wrote:

Thanks for the response. Actually putting aside the animation part how can
I change the cellsize dynamically. I'm not sure what variable I need to
modify to make the cellsize change. gridview has a cellHeight and cellWidth
but they are not assignable.


Reply to this email directly or view it on
GitHubhttps://github.com/AlanQuatermain/AQGridView/issues/170#issuecomment-9211835.

Collaborator

evadne commented Oct 7, 2012

Can you do some magic so your delegate returns a different cell size
(portrait size for cell), and invoke that magic right before a reloadData
call, all wrapped in an animation block?

On Oct 7, 2012, at 13:05, artangco notifications@github.com wrote:

Thanks for the response. Actually putting aside the animation part how can
I change the cellsize dynamically. I'm not sure what variable I need to
modify to make the cellsize change. gridview has a cellHeight and cellWidth
but they are not assignable.


Reply to this email directly or view it on
GitHubhttps://github.com/AlanQuatermain/AQGridView/issues/170#issuecomment-9211835.

@artangco

This comment has been minimized.

Show comment Hide comment
@artangco

artangco Oct 8, 2012

Your suggestion worked. I return the necessary size from within portraitSizeForCell. I do need to reloadData to make it work but this has no animation of course. You mention to wrap it in an animation block. Can you explain more what you mean by that?

artangco commented Oct 8, 2012

Your suggestion worked. I return the necessary size from within portraitSizeForCell. I do need to reloadData to make it work but this has no animation of course. You mention to wrap it in an animation block. Can you explain more what you mean by that?

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