2012-12-28 89 views
1

我已經設置了UIInterfaceOrientationMaskAll方法supportedInterfaceOrientations方法。 當我出示UIModalViewController時,無論屏幕旋轉如何,我總能獲得視圖748 x 1024的尺寸。如果我旋轉屏幕,尺寸沒有得到更新,並在縱向和橫向模式是相同的:748 x 1024時ModalViewController尺寸方向變化

這是呈現模式視圖代碼:

MyModalViewController *myModal = [[MyModalViewController alloc] initWithNibName:nil bundle:nil]; 
[self presentModalViewController:myModal animated:YES]; 

MyModalViewController擴展另一個MyCUSTOMViewController這是的UIViewController一個子類:

@interface MyModalViewController : MyCUSTOMViewController 

@interface MyCUSTOMViewController : UIViewController 

我在做什麼錯?

回答

1

從我看過有幾件事情要考慮:

  1. 若要使其他方位整個應用程序,你必須覆蓋內-(NSUInteger)application:(UIApplication*)application supportedInterfaceOrientationsForWindow:(UIWindow*)window應用程序的UIApplicationDelegate,並返回UIInterfaceOrientationMaskAll
  2. 在您的自定義視圖 - 控制你需要重寫兩個方法:
- (BOOL)shouldAutorotate 
{ 
    return YES; 
} 

- (NSUInteger)supportedInterfaceOrientations 
{ 
    return UIInterfaceOrientationMaskAll; 
} 
+0

不幸的是,這是行不通的。 –

+0

實際上你指的是哪些尺寸?框架 ?邊界? – tiguero

+0

框架尺寸... –