新しいメッセージを作成するとき、iphoneはアニメーションを使用します(新しいビューは画面の下部から表示されます)。そのアニメーションをアプリケーションに追加したいと思います。しかし、あらかじめ定義されたトランジションアニメーションタイプではそれを見つけることはできません。 どうすれば追加できますか?
私に助けてください。ビュー間の遷移をアニメーション化する方法は?
0
A
答えて
6
あなたはこのような他のUIViewControllersに切り替えることができます。このメソッドが呼び出され
[self presentModalViewController:yourUIViewController animated:YES];
のようなアニメーションの多くの種類があります...
yourUIViewController.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentModalViewController:yourUIViewController animated:YES];
yourUIViewController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:yourUIViewController animated:YES];
yourUIViewController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentModalViewController:yourUIViewController animated:YES];
0
これは、何が必要です:あなたはそれを下から来るようにするために、このモーダルトランジションのスタイルを指定する必要があなたの場合は
- (void)presentModalViewController:(UIViewController *)modalViewController animated:(BOOL)animated;
:
UIViewController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentModalViewController:yourUIViewController animated:YES];
+0
を参照してください。 – Joze
0
あなたは意見を両立させるべきではありません直接。トップレベルのビューにはビューコントローラが関連付けられている必要があります(コントローラはpresentModalViewController:animated:
メソッドのように)。
-1
- (void) buttonTouch
{
myView *Obj=[[myView alloc]init];
[self presentModalViewController:Obj animated:YES];
}
- (void) buttonTouch
sの下から上にスライドするmyViewを表示しますメール作成者やメッセージ作成者のようなクレン。
-(void) dismissmyView
{
[self dismissModalViewControllerAnimated:YES];
}
-(void) dismissmyView
それは却下されますと呼ばれるか、これはあなたには、いくつかの遅延と異なるビュー間の遷移をアニメーション化する方法である現在のModalView
すなわちMYVIEW
0
をキャンセルするこの方法。
- (void)viewsAction:(id)sender
{
First *first = [[First alloc] init];
first.view.frame = CGRectMake(0, 0, 320, 425);
CATransition *transitionAnimation = [CATransition animation];
[transitionAnimation setDuration:1];
[transitionAnimation setType:kCATransitionFade];
[transitionAnimation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseIn]];
[first.view.layer addAnimation:transitionAnimation forKey:kCATransitionFade];
[self.view addSubview:first.view];
[first release];
self.timer = [NSTimer scheduledTimerWithTimeInterval:23 target:self selector:@selector(Second) userInfo:nil repeats:NO];
}
-(void)Second
{
Second *second = [[Second alloc] init];
second.view.frame = CGRectMake(0, 0, 320, 425);
CATransition *transitionAnimation = [CATransition animation];
[transitionAnimation setDuration:1];
[transitionAnimation setType:kCATransitionPush];
[transitionAnimation setSubtype:kCATransitionFromRight];
[transitionAnimation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];
[second.view.layer addAnimation:transitionAnimation forKey:kCATransitionPush];
[self.view addSubview:second.view];
[second release];
self.timer = [NSTimer scheduledTimerWithTimeInterval:27 target:self selector:@selector(Third) userInfo:nil repeats:NO];
}
希望します。
関連する問題
- 1. 同じビューでコンテンツの遷移をアニメーション化する方法のアイデア
- 2. アニメーションをビュー遷移にフックする
- 3. Python、Gtk、Cairoで遷移をアニメーション化する方法は?
- 4. ViewPager間のアニメーションの遷移
- 5. ビューをアニメーション化する簡単な方法アクティビティ間での遷移の切り替え
- 6. FragNavライブラリのフラグメント間の遷移をアニメーション化します
- 7. 2つのモーダルViewController間のアニメーション化された遷移
- 8. UINavigationControllerのビュー間の遷移のアニメーションはどのくらいですか?
- 9. SpriteKitアニメーション間の適切な遷移
- 10. アニメーション/遷移
- 11. ページ遷移アニメーション
- 12. HTMLページ間で遷移する方法
- 13. Androidアクティビティ遷移アニメーション
- 14. UWPページ遷移アニメーション
- 15. 既存のアニメーションでビューをアニメーション化する方法は?
- 16. 遷移アニメーションによる遅延アニメーション
- 17. アクティビティ遷移アニメーションのスライドイン/アウト
- 18. アニメーションからの遷移
- 19. Angular 4、遷移とクエリでSVGをアニメーション化する
- 20. androidでこのようなビュー遷移をデザインする方法
- 21. ページ遷移中にアニメーションgifを持つ方法は?
- 22. jquery:移動をアニメーション化する方法
- 23. UITabBarControllerビュー遷移エラー
- 24. ストーリーボードとビューの遷移
- 25. Objective-Cビュー間の遷移中に発生する問題
- 26. 遷移アニメーションの開始位置が間違っています
- 27. プロセッサ間の遷移
- 28. AnimationSetを使用したアクティビティ間の遷移アニメーション
- 29. カリバーンマイクロで画面間の遷移アニメーションをスライディング
- 30. CSSの高さの遷移がアニメーション化していません
+1また、iOS 5.0以降では、[UIViewController presentViewController:animated:completion:]もあります。これを行うのが好ましい方法だけでなく、より多くのオプションをもっと簡単に与えるだけです(完了ブロックではアニメーションが終了した後***のアクションをキューに入れることができます)!!! – mbm29414