iphone - MapView Custom annotation drop -
i trying create custom annotation map. problem have , can't make annotation drop 1 after other. pins drop down @ same time. here delegate code didaddannotations. can me rewrite code can make custom annotations drop 1 after other..just happens when use default annotations. in advance....!!!!
- (void) mapview:(mkmapview *)mapview didaddannotationviews:(nsarray *)views { cgrect visiblerect = [mapview annotationvisiblerect]; (mkannotationview *view in views) { cgrect endframe = view.frame; cgrect startframe = endframe; startframe.origin.y = visiblerect.origin.y - startframe.size.height; view.frame = startframe; [uiview beginanimations:@"drop" context:null]; [uiview setanimationduration:1]; view.frame = endframe; [uiview commitanimations]; } // end of } // end of delegate
you add delay becomes little longer in each iteration of loop, this:
double delay = 0.0; (mkannotationview *view in views) { cgrect endframe = view.frame; cgrect startframe = endframe; startframe.origin.y = visiblerect.origin.y - startframe.size.height; view.frame = startframe; [uiview beginanimations:@"drop" context:null]; [uiview setanimationduration:1.0]; [uiview setanimationdelay:delay]; view.frame = endframe; [uiview commitanimations]; delay += 0.1; }
Comments
Post a Comment