古いスクービードゥーの漫画のミステリー回転壁のようなアプリ内の遷移が必要です。ビューの切り替え時に画面を回転させたい。これを達成する可能性について、誰かが私を正しい方向に向けてくれますか?
2 に答える
2
または、これははるかに少ないインクを使用します。
UIView *bookCaseView; // this is the container... the haunted wall
UIView *booksView; // just an ordinary set of books, right?
UIView *spookyBackside; // ruh-roh, raggy!
[UIView transitionWithView:containerView
duration:0.2
options:UIViewAnimationOptionTransitionFlipFromLeft
animations:^{
[booksView removeFromSuperview];
[bookCaseView addSubview:spookyBackside]; }
completion:NULL];
于 2012-05-06T00:58:11.187 に答える
0
これがあなたが探しているものだと思います:
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.0];
//optional if you want to do something after the animation
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(myAnimationDidFinish:finished:context:)];
//
[view2 setFrame:CGRectMake(0, 0, view2.frame.size.width, view2.frame.size.height)];
[view1 addSubview:view2];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:view1 cache:YES];
[UIView commitAnimations];
そして裏返すには:
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.0];
//optional if you want to do something after the animation
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(myOtherAnimationDidFinish:finished:context:)];
//
[view2 removeFromSuperview];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:view1 cache:YES];
[UIView commitAnimations];
于 2012-05-06T00:37:14.777 に答える