我正在使用與導航控制器關聯的選項卡欄的iphone應用程序。在其中一個控制器中,我有一個表視圖,顯示了一些列表,以及何時選擇了一行,另一個視圖顯示特定的信息和一個按鈕來查看一些相關的照片。在iPhone設備上旋轉處理橫向顯示
我在橫向顯示照片視圖時出現問題。
照片視圖控制器包含一個UIImageView,一次顯示一張照片,此ImageView對象大小爲320x460,以全屏模式顯示。爲了處理旋轉我已經添加下面的代碼:
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait || interfaceOrientation == UIInterfaceOrientationLandscapeLeft || interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}
但它不旋轉和iPhone模擬器狀態欄仍處於縱向位置,所以不旋轉了。
我也改變了這樣的方法:
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
}
還是關於設備旋轉沒有變化。 項目 - >摘要(選項卡) - >支持的設備方向 - >所需的方向中的選項明確啓用橫向模式(右/左)。
你能幫我瞭解我可能錯過了什麼嗎?
THX幫助,
斯特凡
你認爲我可以調用視圖模式可以解決這個問題? – Steve
只是重寫視圖控制器中的'shouldAutorotateToInterfaceOrientation'方法,由選項卡控件打開並使用上面的代碼:) –
@StephaneKouakou我不知道旋轉模式視圖控制器從標籤欄控制器推送時會發生什麼。 – morningstar