是否可以使用PresentModalViewController與使用導航控制器的「pushViewController」方法時顯示的相同動畫?PresentModalViewController具有與導航控制器中的推送視圖相同的動畫?
2
A
回答
1
據我所知,它不能水平移動。而且,當您使用presentModalViewController:animated:
時,以前的視圖將消失(空白)。但是你可以做這樣的(添加所需的視圖到你的窗口的頂部):
UIViewController *modalViewController = [[UIViewController alloc] init];
[modalViewController.view setFrame:CGRectMake(320.0f, 0.0f, 320.0f, 480.0f)];
[modalViewController.view setBackgroundColor:[UIColor redColor]];
[[UIApplication sharedApplication].delegate.window addSubview:modalViewController.view];
[UIView animateWithDuration:0.25f
delay:0.0f
options:UIViewAnimationOptionCurveEaseInOut
animations:^{
[modalViewController.view setFrame:CGRectMake(0.0f, 0.0f, 320.0f, 480.0f)];
}
completion:nil];
[modalViewController release];
0
我會建議UIStoryboardSegue
,而不是批准的回答以上。這似乎是實現效果和視圖層次結構的正確方法。
它可與presentModalViewController:animated:
一起使用,如「執行」下的文檔末尾所述。
相關問題
- 1. 推動視圖控制器沒有動畫導航欄
- 2. 導航控制器推送 - 視圖 - 控制器
- 3. 導航控制器推送會停止前一個視圖上的動畫嗎?
- 4. 釋放與導航控制器相關的視圖控制器
- 5. 將視圖控制器推送到導航期間的動畫。控制器有時會停止工作
- 6. 在自定義視圖控制器轉換中抑制導航推動動畫
- 7. 導航項目標題視圖 - 對於所有推送的視圖控制器都相同
- 8. 帶有2個導航欄的導航控制器 - 如何調整推送視圖控制器的框架?
- 9. 將視圖控制器推入導航控制器的問題
- 10. 推兩個導航控制器的視圖控制器
- 11. 目標視圖控制器如何以編程方式推送到相同的導航控制器,Swift
- 12. 從導航控制器推送的視圖控制器不顯示
- 13. 在導航控制器的視圖中翻轉動畫
- 14. 動畫導航控制器轉換沒有動畫導航欄
- 15. 推動從右側的視圖控制器,動態導航控制器
- 16. PresentModalViewController視圖與沒有動畫
- 17. 模擬推動導航控制器的更新視圖
- 18. 如何通過導航推送數據視圖控制器
- 19. 推視圖控制器無法動畫
- 20. 將視圖控制器推入導航控制器
- 21. 導航控制器推零視圖控制器錯誤
- 22. UI塊,而在推視圖控制器導航控制器
- 23. IOS動畫沒有導航控制器
- 24. Tabbar具有相同的導航控制器
- 25. 如何從一個導航控制器推送到多個視圖控制器?
- 26. 如何在推動導航控制器後移動視圖?
- 27. 返回導航按鈕沒有顯示在推送的視圖控制器
- 28. self.navigationcontroller在沒有導航項的情況下推送視圖控制器
- 29. iPhone中的導航視圖控制器
- 30. 推的UIViewController沒有導航控制器