2013-02-01 124 views
2

我想在我的应用程序中只将我的一个视图右转。 我的所有其他视图都处于肖像模式。以前的视图处于肖像模式。我将横向视图推向纵向视图。我如何正确地做到这一点?

This portrait(rootviewcontroller)从纵向模式到iOS5,iOS6的横向模式


This landscape

在我的横向视图控制器

//Orientation 
-(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation{ 
    return (toInterfaceOrientation == UIInterfaceOrientationLandscapeRight); 
} 
// New Autorotation support 
-(BOOL)shouldAutorotate { 
    return YES; 
} 

-(NSUInteger)supportedInterfaceOrientations{ 
    return UIInterfaceOrientationMaskLandscapeRight; 
} 

回答

0

您可以在您使用此浏览器

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
    return (interfaceOrientation == UIInterfaceOrientationLandscapeRight); 
} 

这将确保取向风景r飞行。

+0

这种方法在iOS6的 – Leena

+0

的Leena不赞成你是对的 –

0

对于一个设备,你可以做总和THNG这样改变方向..

-(void)viewDidLoad 
{ 
    orientation = [[UIDevice currentDevice] orientation]; 
    if(intOrientation == UIInterfaceOrientationLandscapeRight) 
       orientation = UIDeviceOrientationLandscapeRight; 

} 

希望它可以帮助你

相关问题