是否可以使用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. PresentModalViewController視圖與沒有動畫
- 9. 模擬推動導航控制器的更新視圖
- 10. 將視圖控制器推入導航控制器
- 11. 導航控制器推零視圖控制器錯誤
- 12. UI塊,而在推視圖控制器導航控制器
- 13. Tabbar具有相同的導航控制器
- 14. 返回導航按鈕沒有顯示在推送的視圖控制器
- 15. self.navigationcontroller在沒有導航項的情況下推送視圖控制器
- 16. 具有表格視圖的導航控制器
- 17. presentModalViewController與modalTransitionStyle導致所有控件XIB爲「動畫中的」
- 18. 導航控制器不推動另一個視圖
- 19. 如何推動視圖控制器與翻轉動畫
- 20. 帶有導航控制器的視圖控制器
- 21. 如何推動要求視圖控制器到導航控制器在迅速
- 22. 滾動文本與導航控制器的視圖
- 23. 推送視圖控制器的問題
- 24. iOS推送導航控制器,在第二個視圖上沒有酒吧
- 25. 從導航欄視圖控制器導航到標籤欄視圖控制器
- 26. 如何調用視圖控制器與導航控制器
- 27. 導航欄向上移動,同時導航控制器的彈出動畫
- 28. Tab控制器正在被導航控制器推送
- 29. 在新的導航控制器中嵌入視圖控制器
- 30. 多個導航控制器中的視圖控制器通信