我正在製作一個應用程序,只是爲了好玩,它似乎工作正常,除了事實上,當我希望它只在一個屏幕上的風景,它將保持肖像。我怎樣才能使它在加載時自動旋轉到橫向? 我已經試過這個:iOS:如何在另一個視圖向其轉動時旋轉視圖控件?
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight) || (interfaceOrientation == UIInterfaceOrientationLandscapeLeft);
}
但是,這似乎並沒有工作。只有當我旋轉設備時,它纔會旋轉視圖,然後它會保持橫向,但我希望它能夠在加載時儘快完成,而不必讓用戶旋轉設備以將其從肖像中移出。有什麼我失蹤的?感謝您的幫助!如果你想從應用程序獲得更多的代碼,我將非常樂意與你分享。