0

I have a separate landscape view of a clock i've made and I want this to cross dissolve in when the phone is rotated to landscape, and then cross dissolve back when it returns to portrait, but when I've tried this in different ways, i've been having problems.

Suggestions on how I can do this?

4

1 に答える 1

1

ビューコントローラのメインビューのサブビューとして、2つの別々のビューを追加します。

埋め込む:

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration

ビューコントローラで、クロスディゾルブを処理するために次のようなコードを追加します。

[UIView beginAnimations: @"cross dissovle" context: NULL];
[UIView setAnimationDuration: 1.0f];
self.firstView.alpha = 0.0f;
self.secondView.alpha = 1.0f;
[UIView commitAnimations];

明らかに、他のケースを実装し、その周りにいくつかのロジックを配置する必要がありますが、それは読者の練習問題として残されています;-)。

于 2011-01-05T09:01:32.470 に答える