2012-12-05 3 views

답변

2

ViewController

-(NSUInteger)supportedInterfaceOrientations 
{ 

    return UIInterfaceOrientationMaskLandscape; 
} 
+0

감사 Mindaugas의가! 내가 이미 그것을 –

0

당신이 UINavigationController가를 사용하고 당신이 방법을 추가?

- (NSUInteger)supportedInterfaceOrientations 
{ 
    return UIInterfaceOrientationMaskLandscape; 
} 

-(BOOL) shouldAutorotate { 
    return YES; 
} 
+0

감사 Markm을 할 수있다! 네, 내비게이션 컨트롤러를 사용하고 있습니다 –

+0

시도해 봅니다. 그러나 제대로 작동하지 않습니다. –

4

당신이 탐색 컨트롤러이 '풍경 중심의'뷰 컨트롤러를 추진하고있다 컨트롤러를 사용하는 경우는 다음 CGAffineTransformation으로 UIView의 회전을 수동으로해야합니다에만 세로 모드에 있습니다. 보정

- (void)viewDidLoad 
{ 
    [super viewDidLoad]; 
    // If you require full screen then hide the navigation bar with following commented line. 
    //[self.navigationController setNavigationBarHidden:YES animated:NO]; 

    // Rotates the view. 

    CGAffineTransform transform = CGAffineTransformMakeRotation(-M_PI/2); 
    self.view.transform = transform; 

    // Repositions and resizes the view. 
    // If you need NavigationBar on top then set height appropriately 
    CGRect contentRect = CGRectMake(0, 0, 480, 320); 
    self.view.bounds = contentRect; 
} 
+0

답장을 보내 주셔서 감사합니다! BUY sory 그게 나를 위해 작동하지 않습니다 –

+0

@Abid, 당신은 저를 구해 주셔서 감사합니다 ... –

+0

감사합니다 .. .. 그 일하는 awesomeeeeee ... 나는 많은 시간을 보냈다. 아주 좋은 답변 .. 그것은 나를 위해 잘하고있다. – Surya

관련 문제