开发者

When popping to a previous viewcontroller I get a duplicate of itself during the transition

开发者 https://www.devze.com 2023-01-27 06:21 出处:网络
I am using the following code to popping to a parent view controller (not always the direct parent in the stack), but for some reason I get the current view controller slide in over itself before the

I am using the following code to popping to a parent view controller (not always the direct parent in the stack), but for some reason I get the current view controller slide in over itself before the parent I am popping to.

CATransition* transition = [CATransition animation];
transition.type = kCATransitionPush;
transition.subtype = kCATransitionFromLeft;
[self.navigationController.view.layer addAnimation:transition forKey:kCATransition];
[self.navigationController popToViewCont开发者_运维问答roller:vc animated:YES];
hasPopped = YES;

This appears to be down to the animation code Im using. The only reason I am setting this is because when the app is rotated to landscape the views come in from the bottom on the side. As raised in this question: https://stackoverflow.com/questions/4102345/why-do-views-slide-out-at-the-bottom-when-landscape


I solved this by turning the animated:off during the pop as the assigned animation was providing it

0

精彩评论

暂无评论...
验证码 换一张
取 消