2010-04-15 41 views
0

一個簡短的問題。UIView Animation:PartialCurl ...在旋轉過程中的錯誤?

我已經爲iPad創建了一個應用程序,非常像iPhone的實用程序應用程序(一個mainView,一個flipSideView)。它們之間的動畫是UIModalTransitionStylePartialCurl。 shouldAutorotateToInterfaceOrientation返回YES。

如果我在進入FlipSide之前旋轉設備,一切正常,並且PartialCurl顯示正常。 但是,如果我進入FlipSide,然後旋轉設備,而UIElements旋轉並將它們自己定位得很好,則實際的「頁面捲曲」將保持其初始方向。它只是不會讓步:)

這是一個已知的問題嗎?難道我做錯了什麼? 謝謝!

回答

0

我也有這個問題,有些放棄。然而,我向一位朋友提到了我的困境,他鼓勵我研究小孩VC的邏輯,並回想一下我用來在父/子視圖控制器之間傳遞數據的方便技巧。

在你的flipside視圖控制器中,創建一個「rootViewController」屬性。在你父視圖控制器,當你初始化另一面視圖控制器,可以設置(其中,「自我」是rootVC):

flipsideController.rootViewController = self; 

然後,您可以使用此爲您的另一面VC的shouldAutorotateToInterfaceOrientation方法:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 
    return interfaceOrientation == self.rootViewController.interfaceOrientation; 
} 

中提琴!翻轉視圖不再在部分捲曲的父視圖下旋轉!

0

上述代碼的最短的方法是:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
    return interfaceOrientation == self.parentViewController.interfaceOrientation; 
}