我正在開發的iPhone應用程序中有一個奇怪的問題。我希望我的應用程序僅支持縱向模式,但由於某種原因,我無法執行此操作(設備&模擬器)。如何僅在iPhone應用程序上支持肖像模式
只支持縱向模式我做了如下:
- 在上Xcode中TARGET摘要部分,我只選擇了肖像。
- 我所有的ViewControllers實現
shouldAutorotateToInterfaceOrientation
但正如我所說,它不會工作,而奇怪的結果是,應用程序的支持ALL的方向(縱向,上下顛倒,景觀左,右景觀) 。
任何想法?
這個我如何實現shouldAutorotateToInterfaceOrientation
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
NSLog(@"Checking orientation %d", interfaceOrientation);
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
我注意到剛纔,當我旋轉手機,我得到這個消息:
「兩級旋轉動畫被棄用此應用程序應該 使用更流暢的單段動畫。「
這是什麼意思?
從每個地方返回NO。 – Nilesh 2012-04-05 18:13:17
試試我的答案。也許它會有所幫助。 – 2012-04-06 10:45:15
試着在你的'shouldAutorotateToInterfaceOrientation'方法中添加'NSLog(@「檢查方向%d」,interfaceOrientation);''。當您旋轉模擬器或您的設備時是否調用了它們中的任何一個? – Dondragmer 2012-04-07 22:48:42