Animate UIView height from bottom to top

前端 未结 6 616
Happy的楠姐
Happy的楠姐 2021-02-02 17:35

I\'m doing a simple animation of UIView height so that it reveals.

By default it seems to be revealing from top to bottom, and I want it to reveal bottom to top.

<
6条回答
  •  Happy的楠姐
    2021-02-02 17:53

    one way I've done it with an AdWhirlView, hide it below the screen, then animate it up;

    AdWhirlView *adWhirlView = [AdWhirlView requestAdWhirlViewWithDelegate:self];
    adWhirlView.delegate = self;
    adWhirlView.frame = CGRectMake(0, 430+kAdWhirlViewHeight, kAdWhirlViewWidth, kAdWhirlViewHeight);
    [self.parentViewController.view insertSubview:adWhirlView belowSubview:self.view];
    
    [UIView beginAnimations:@"AdWhirlIn" context:nil];
    [UIView setAnimationDuration:.5];
    [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
    adWhirlView.frame = CGRectMake(0, 430, kAdWhirlViewWidth, kAdWhirlViewHeight);
    [UIView commitAnimations];
    

提交回复
热议问题