在UIView子类中,我有以下内容:
self.frontImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"front"]];
self.backImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"back"]];
[self addSubview:self.backImageView];
[UIView animateWithDuration:0.5
delay:0.0
options:UIViewAnimationOptionTransitionFlipFromLeft
animations:^{
[self.backImageView removeFromSuperview];
[self addSubview:self.frontImageView];}
completion:^(BOOL finished){
//nothing
}];但我不明白翻转动画。前面的图像视图会立即出现。我做错了什么?
发布于 2013-02-23 04:07:56
你犯了一个愚蠢的错误
animateWithDuration:delay:options:animations:completion:而不是
transitionFromView:toView:duration:options:completion:你的代码应该是:
[UIView transitionFromView:backImageView
toView:frontImageView
duration:0.5
options:UIViewAnimationOptionTransitionFlipFromLeft
completion:^(BOOL finished) {
// animation completed
}];https://stackoverflow.com/questions/15031793
复制相似问题