View动画的一些问题

时间:2014-03-05 07:12:56

标签: objective-c ios7 uiviewanimation

我正在尝试在我的视图上创建动画。现在我有任何麻烦。动画仅适用于_pageViewController

_pageViewController.view.frame = frame;
_pageViewController.view.alpha = alpha;

但_bottomImage.frame = frame1;不起作用。我不明白为什么? 如果我评论这一行

 //_pageViewController.view.frame = frame;
 //_pageViewController.view.alpha = alpha;

_bottomImage.frame = frame1开始工作。 我做错了什么?

  - (IBAction)share:(id)sender {
    CGRect frame =self.pageViewController.view.frame;
    CGRect frame1 = _bottomImage.frame;
    float alpha = 1.0;
    if (frame.origin.y==65.0) {
        frame.origin.y = 240;
        frame1.origin.y = 650;
        alpha = 0.5;   
        [UIView beginAnimations:nil context:nil];
        [UIView setAnimationDuration:5.5];
        [UIView setAnimationDelay:0.1];
        [UIView setAnimationCurve:UIViewAnimationCurveEaseOut];
        _pageViewController.view.frame = frame;
        _pageViewController.view.alpha = alpha;
        _bottomImage.frame = frame1;
        [UIView commitAnimations];
    }else{
        [self closeShare];
    }
}

0 个答案:

没有答案