我有一個視圖控制器,我有這樣的代碼有:以查看問題旋轉,即使我不歸路上shouldAutorotate
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return NO;
}
但是,如果我改變了方向,角度旋轉。任何人都可以幫助我嗎?
我有一個視圖控制器,我有這樣的代碼有:以查看問題旋轉,即使我不歸路上shouldAutorotate
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return NO;
}
但是,如果我改變了方向,角度旋轉。任何人都可以幫助我嗎?
這裏是我怎麼做,以保持一個iPad在橫向模式下:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if (interfaceOrientation==UIInterfaceOrientationLandscapeLeft || interfaceOrientation==UIInterfaceOrientationLandscapeRight)
{
return YES;
}
else
{
return NO;
}
}
嘗試使其返回YES,如果它是你支持的方向(你至少需要1對不對?)。根據UIViewController(或使用此方法確定旋轉的代碼)的實現,這可能會也可能不會幫助您解決問題,但會更加正確。 – Matt
@Matt:我也試過這樣的方式呢......不工作:( – Ahsan
與我同樣的問題,什麼解決了你的問題? – mvb