我在使用[self presentModalViewController:head animated:NO];
在ios 4.3中,並尋找替代ios 5及以上。我寧願使用通用的iOS版本,但if (iOS is lower than 6)
也可以很好。 我的問題是,使用[self presentViewController:head animated:YES completion:nil];
作爲替代將工作只有如果animated
設置爲YES
。任何想法爲什麼?我不想讓它動畫。如果我是而不是使用StoryBoards
?presentViewController將無法使用動畫:NO
0
A
回答
1
該應用程序是否失敗?你有NSZombies啓用?
如果你正在做這樣的事情
- (id)init {
self = [super init]
if (self) {
ViewController * viewController = [[ViewController alloc] init];
[self presentViewController:viewController animated:YES];
}
return self;
}
這是因爲視圖尚未啓動,請使用下列方法之一
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
ViewController * viewController = [[ViewController alloc] init];
[self presentViewController:viewController animated:YES];
}
// OR
- (void)viewDidLoad {
[super viewDidLoad];
ViewController * viewController = [[ViewController alloc] init];
[self presentViewController:viewController animated:YES];
}
我明白,這可能不是回答你問題,但你沒有發佈它的發起者。但這是一個常見的錯誤,所以我認爲我會張貼它解決你的問題。
相關問題
- 1. setViewControllers當動畫使用:NO
- 2. MFMailComposeViewController - 無法presentViewController
- 3. presentViewController從側面的動畫
- 4. presentViewController:動畫:完成:失敗
- 5. PresentViewController與自定義動畫
- 6. 無法獲得presentViewController工作
- 7. CCDirector可能不會響應presentviewcontroller:動畫
- 8. presentViewController重置所有的UIView動畫
- 9. iOS的presentViewController動畫關閉時
- 10. PresentViewController呈現視圖:動畫:完成:不工作時presentViewController:動畫:完成:熱點啓用
- 11. 導航動畫wp8 no silverlight
- 12. 無法動畫
- 13. 我的動畫將無法啓動
- 14. 用NO動畫執行segue嗎?
- 15. Css動畫無法使用變換
- 16. 角度動畫無法使用swappable divs
- 17. 動畫師無法使用的SetFloat
- 18. UIView動畫無法使用addSubview
- 19. CSS3動畫在XP中無法使用?
- 20. 我無法使用magnific-popup動畫
- 21. 無法啓動sinatra進程 - eventmachine「no acceptor」
- 22. Apache無法啓動(Ubuntu 16.04)no error.log
- 23. 無法將UIButton.highlighted設置爲NO
- 24. 在angularjs中編寫動畫(僅JavaScript使用NO CSS動畫!)指令
- 25. 使用presentviewcontroller迅速
- 26. 如何使用presentViewController
- 27. CSS動畫(翻轉)將無法在Safari
- 28. 使用presentViewController後無法找到現有的segues
- 29. 無法將文本放入使用HTML 5畫布動畫的框中
- 30. CSS動畫無法啓動
你可以包含問題的代碼片段嗎? –
以上是我用來在ViewControllers之間移動的唯一代碼。 – Segev