上下切换卡片

2018-04-09  本文已影响0人  春困_秋乏

上下切换卡片

效果


-(void)firstAction:(UIGestureRecognizer*)gen{

    [UIView animateWithDuration:.2 animations:^{

        _secodView.frame = CGRectMake(20, 0, [UIScreen mainScreen].bounds.size.width - 40 - 40, 400 - 50);

        _firstView.frame = CGRectMake(0, -50, [UIScreen mainScreen].bounds.size.width - 40 , 400 - 50);

        [_bgView sendSubviewToBack:_secodView];

        [_bgView bringSubviewToFront:_firstView];

    }completion:^(BOOLfinished) {

    }];

}

-(void)secondAction:(UIGestureRecognizer*)tag{

    [UIView animateWithDuration:.2 animations:^{

        _secodView.frame = CGRectMake(0, 50, [UIScreen mainScreen].bounds.size.width - 40, 400 - 50);

        _firstView.frame = CGRectMake(20, 0, [UIScreen mainScreen].bounds.size.width - 40 - 40, 400 - 50);

        [_bgView sendSubviewToBack:_firstView];

        [_bgView bringSubviewToFront:_secodView];

    }completion:^(BOOLfinished) {

    }];

}

上一篇 下一篇

猜你喜欢

热点阅读