在 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
}];
但我没有得到翻转动画。正面图像视图立即出现。我究竟做错了什么?