簡體   English   中英

iPhone PushViewController到風景

[英]iphone pushviewcontroller to landscape

我有簡單的iPhone應用程序。 它有3個意見。 第一個視圖是具有3個按鈕的縱向視圖。 第二個視圖有一個表視圖,它也是一個肖像。 在第一個視圖中,單擊按鈕會顯示第二個視圖。 在第二視圖中單擊單元格時,將顯示第三視圖。 但是第三種觀點是風景。 我正在使用“ pushViewController”從每個視圖導航。 在IB中創建視圖時,前兩個視圖為肖像,第三個視圖為風景。 在3rd viewcontroller中,我也使用以下代碼:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
//return UIInterfaceOrientationIsLandscape(interfaceOrientation);
return ((interfaceOrientation == UIInterfaceOrientationLandscapeRight) || (interfaceOrientation == UIInterfaceOrientationLandscapeLeft));

}

如何顯示人像的前兩個視圖和風景中的第三個視圖。

嘗試將其放在viewDidLoad中

[[UIApplication sharedApplication] setStatusBarOrientation:UIDeviceOrientationLandscapeLeft animated:YES];

該線程中有指向相關問題的鏈接的集合。 特別是,請在此處檢查pix0r的答案。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM