美文网首页
iOS Push模拟Pop模态底部弹出动画

iOS Push模拟Pop模态底部弹出动画

作者: Cingjin | 来源:发表于2019-04-08 09:03 被阅读0次
    - (void)whenPush{
    
        WTVViewController * loginView = [[WTVViewController alloc]init];
        CATransition* transition = [CATransition animation];
        transition.duration =0.4f;
        transition.type = kCATransitionMoveIn;
        transition.subtype = kCATransitionFromTop;
        [self.navigationController.view.layer addAnimation:transition forKey:kCATransition];
        [self.navigationController pushViewController:loginView animated:NO];
        // * 此处animated设置为NO
        
    }
    
    - (void)whenPop{
    
        CATransition* transition = [CATransition animation];
        transition.duration =0.4f;
        transition.type = kCATransitionReveal;
        transition.subtype = kCATransitionFromBottom;
        [self.navigationController.view.layer addAnimation:transition forKey:kCATransition];
        [self.navigationController popViewControllerAnimated:NO];
        //* 此处animated设置为NO
        
    }
    

    相关文章

      网友评论

          本文标题:iOS Push模拟Pop模态底部弹出动画

          本文链接:https://www.haomeiwen.com/subject/yxiyiqtx.html