1
我正在研究一個模塊,當我得到它時,屏幕處於橫向模式。我必須加載一個新的視圖,並切換到肖像模式。雖然這看起來很簡單,但我一直無法找到一個簡單的解決方案。以下是我的嘗試:加載視圖時如何從橫向旋轉到縱向?
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait];
locationsView =[[LocationsViewController alloc] initWithNibName:@"LocationsViewController" bundle:nil];
[self.view addSubview:locationsView.view];
而且沒有像我需要的那樣工作。它將狀態欄旋轉到縱向模式,但不是視圖的其餘部分。
有什麼建議嗎?
托馬斯