2013-04-29 71 views
1

我正在開發一個應用程序,其中有一個UIViews在一個UIViewController中。現在的問題是它具有所有UIViews在橫向模式下,這裏只有一個UIView是縱向的。我無法使用shouldAutorotate方法獲得此特定輸出。ios 6.0及更高版本中的Orientatin問題

有人可以建議我具體的方法來解決這個問題。

回答

2

@ PRATIK-bhiyani謝謝... 但我已經做了這樣的代碼來獲取特定的代碼時,我需要旋轉我的看法

- (IBAction)btnClickToRedeem:(id)sender 
{ 
    isPortraitRqurd = TRUE; 
    [self shouldAutorotate]; 
} 

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation 
{ 
    if(isPortraitRqurd) 
     return (toInterfaceOrientation == UIInterfaceOrientationPortrait || toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown); 
    else 
     return (toInterfaceOrientation == UIInterfaceOrientationLandscapeRight || toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft); 

} 

-(BOOL)shouldAutorotate 
{ 
    return YES; 
} 

-(NSUInteger)supportedInterfaceOrientations 
{ 
    if(isPortraitRqurd) 
     return UIInterfaceOrientationMaskPortrait; 
    else 
     return UIInterfaceOrientationMaskLandscape; 
} 

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation 
{ 
    if(isPortraitRqurd) 
    { 
     return UIInterfaceOrientationPortrait; 
     isPortraitRqurd = FALSE; 
    } 

    else 
     return UIInterfaceOrientationLandscapeRight; 
} 
+0

你取得了構建環境的變化? – 2013-04-29 05:25:17

+0

是的,我做了它,然後也不能從景觀設置肖像視圖。 – 2013-04-29 05:35:20

+0

返回YES;並在構建設置中(如圖所示),並按下UpsideDown按鈕並使其變暗。 – 2013-04-29 05:38:07

相關問題