UIViewTransitionfromView の奇妙な動作を理解していないので、最初はアニメーションなしで 2 番目のビューが表示されます。コードは次のとおりです。
UIImageView *backstar=[[UIImageView alloc]initWithFrame:CGRectMake(50, 50, 205, 205)];
backstar.image=[UIImage imageNamed:@"backstar.png"];
UIImageView *star=[[UIImageView alloc]initWithFrame:CGRectMake(50, 50, 205, 205)];
star.image=[UIImage imageNamed:@"star.png"];
UIView *containerView=[[UIView alloc]initWithFrame:CGRectMake(50, 50, 205, 205)];
containerView.backgroundColor=[UIColor blackColor];
[self.view addSubview:containerView];
[containerView addSubview:backstar]; // if I don't do this nothing happens, container view stays f*** deep black
[containerView addSubview:star];
//if i remove the animation line, star is displayed of course, on top of backstar
[UIView transitionFromView:star toView:backstar duration:2.0 options:UIViewAnimationOptionShowHideTransitionViews | UIViewAnimationOptionTransitionFlipFromLeft completion:^(BOOL finished){} ];
私の間違いはどこにあるのですか?Apple doc で述べられているように、imageViews を削除するのではなく、それらを表示/非表示にすることは可能です。
どうもありがとう