1
我的視圖最初處於橫向模式。當一個按鈕被錄音時,一個視圖將以縱向模式打開,並且所有內容都可以在這一點上找到。問題是當我從該視圖返回到根視圖時視圖將無法正確旋轉。這裏是我使用的旋轉從縱向到橫向視圖中的代碼,iPad從縱向轉爲橫向
-(void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
//rotate the page to lansscape
CGAffineTransform landscapeTransform = CGAffineTransformMakeRotation(-90*0.0174532925);
landscapeTransform = CGAffineTransformTranslate (landscapeTransform, 0.0, 0.0);
[self.navigationController.view setTransform:landscapeTransform];
self.navigationController.view.autoresizingMask = UIViewAutoresizingFlexibleWidth |UIViewAutoresizingFlexibleHeight;
self.navigationController.view.frame = CGRectMake(0.0, 0.0, self.view.frame.size.width, self.view.frame.size.height);
self.navigationController.view.center = CGPointMake (384.0, 544.0);
[UIApplication sharedApplication].statusBarOrientation = UIInterfaceOrientationLandscapeLeft;
}
這裏是風景模式根頁面的屏幕截圖從縱向頁面返回後,
這是應該什麼樣子
檢查您的xib方向視圖。 – Santhosh
當然是風景! – Mona