http://segmentfault.com/q/1010000000143983
The default animations for Uinavigationcontroller push and pop are both left and right, and my application requires that the animation of this interface switch be a bit more complex, presumably with a few:
- Faster around the launch, the default is 0.3 seconds, I need to be one times faster
- With jitter around the launch
- Flip horizontally
- Paper Flip Effect
But these switches should be put in the Navigationcontroller to do management, how to achieve, to find a train of thought
Sort By default sorting time 3 answersthe answer is helpful to the person, has the reference value0 The answer is no help, it's the wrong answer, irrelevantly replying .Adopted
YUANLIZBYY 275November 28, 2012 answer
1. If the landlord wants to use the view controller stack in Uinavigationcontroller, and also want to customize the push, pop animation effect, it is basically impossible. The reason is that if you want to use the view controller stack, you can't dodge
Pushviewcontroller:animated: This method, and once used pushviewcontroller:animated:, Uinavigationcontroller will force the frame of the viewcontroller to be pushed into the frame of the current viewable area, thus breaking all the posterior steps that you want to customize the animation for, such as the following code, which will not have any effect:
Uinavigationcontroller+customanimation.h
Uinavigationcontroller (customanimation)-(void) Custompushviewcontroller: (Uiviewcontroller *) Viewcontroller; @end
Uinavigationcontroller+customanimation.m
#import"Uinavigationcontroller+customanimation.h"-(void) Custompushviewcontroller: (Uiviewcontroller *) viewcontroller{Viewcontroller. View. frame = (CGRect) {0,-viewcontroller.view.frame .size.height, Viewcontroller .view.frame.size}; [self pushviewcontroller:viewcontroller animated:NO]; [uiview animatewithduration:.15f animations:^{ Viewcontroller.view.frame = ( cgrect) {0, 0, self .view.bounds.size};}];}
2. If you simply want to add a custom push, pop animation instead of a view controller stack, the following code can be used to achieve a push effect from top to bottom:
Uinavigationcontroller+customanimation.h file Ibid.
Uinavigationcontroller+customanimation.m
#import"Uinavigationcontroller+customanimation.h"-(void) Custompushviewcontroller: (Uiviewcontroller *) viewcontroller{Viewcontroller. View. frame = (CGRect) {0,-viewcontroller.view.frame.size.height, Viewcontroller.view.frame< Span class= "hljs-variable" >.size}; [self.topviewcontroller.view]; [uiview animatewithduration:.15f animations:^{ Viewcontroller.view.frame = ( cgrect) {0, 0, self .view.bounds.size};}];}
the answer is helpful to the person, has the reference value2 The answer is no help, it's the wrong answer, irrelevantly replying .
Navy 1.7kNovember 24, 2012 answer
Although based on Navctrl, you can use Viewctrl Presentmodalviewcontroller without Navctrl push method. As for the speed, these systems are the default of 0.3s, the animation is the system default several.
If you need a variety of custom animation, you can customize the animation is the view, give an example http://www.cocoachina.com/bbs/read.ph ..., for the landlord reference.
the answer is helpful to the person, has the reference value1 The answer is no help, it's the wrong answer, irrelevantly replying .
Finnchen November 23, 2012 answer
Refer to the next http://segmentfault.com/q/10100000001 ...
Write an Answer
Customizing Uinavigationcontroller push and Pop animations