i have finding way call pushviewcontroller scaling animation, facebook iphone app main menu icon click animation. (new viewcontroller popup center, , scales original size.)
i searched several way change animation of pushviewcontroller.
first, tried this:
viewcontroller.view.transform = cgaffinetransformmakescale(0.5f, 0.5f); [uiview animatewithduration:0.5f animations:^{ viewcontroller.view.transform = cgaffinetransformmakescale(1.0f, 1.0f); }]; [self.navigationcontroller pushviewcontroller:viewcontroller animated:no];
but there problem, old viewcontroller disappeared when animation starts, there's white background.
if use catransition change animation, can show both old & new viewcontroller both, there's no scaling animation, move in, push in, fade in animations.
i want show both new & old view controller catransition animations, , need way implement custom animation.
here last suggestion, dirty way:
[self.view addsubview:viewcontroller.view]; viewcontroller.view.transform = cgaffinetransformmakescale(0.5f, 0.5f); [uiview animatewithduration:0.5f delay:0.0f options:uiviewanimationcurveeaseinout animations:^{ viewcontroller.view.alpha = 1.0f; viewcontroller.view.transform = cgaffinetransformmakescale(1.0f, 1.0f); } completion:^(bool finished) { [self.navigationcontroller pushviewcontroller:viewcontroller animated:no]; [viewcontroller release]; }];
first, added new viewcontroller.view subview, can show animation new & old view both. when animation ended, pushviewcontroller later.
this way can implement thought, think dirty way, , there's remain problem:
navigation bar items not change immediately, changed after animation ends.
is there simple, clear way implement animation? think impossible without change original implentation of pushviewcontroller, should subclassing pushviewcontroller?
thanks read, , help.
i don't think animation done view controller. can keep existing view controller. create new uiview supposed zoom in. add new uiview existing view controller , apply animation it.
Comments
Post a Comment