Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
350
How to get updated location value in cellLocationInViewportChanged after changing the cell's frame?
posted

I am using IGGridView with Carousel mode. I have just added the following code to my project. What this method does is to move the circles to the bottom of the screen. 

-(void)doTest{

    NSArray* array = _gridView.visibleCells;

    for (Cell* cell in array) {

        [UIView animateWithDuration:0.5 animations:^{          

            CGRect frame = cell.frame;

            frame.origin.y += 100;            

            cell.frame = frame;

            [self.view layoutIfNeeded];         

        }];

    }

}

The circles move with the animation to the bottom of the screen but when I scroll the grid view, the -(void)cellLocationInViewportChanged:(CGPoint)location returns the initial location values for each cell. So that the circles start moving from their initial location. I thought if I update the cell frames the location parameter was going to return an updated value. Any work around to force the cellLocationInViewportChanged returns updated location value? 

I can ask my question in another way. Where does this location parameter take it's value? Which parameter do I need to change in gridview? Thank you for your support.

Parents
No Data
Reply
  • 40030
    Verified Answer
    Offline posted

    Hi, 

    The cells locations are controlled by the grid. You really shouldn't me changing their positioning outside of it. 

    Sounds like you should just be moving the IGGridView to the bottom, then all of the cells will of course move with it, and the positioning logic will be in tact. 

    -SteveZ

Children
No Data