2013-07-02 39 views
0

我的银行应用程序设计良好。纵向显示我帐户中的动作,如果iPhone处于横向模式(右侧或左侧),则会显示带有两个轴的图表。我该如何做这样的事情?我在我的应用程序很多意见,我只需要在人像模式,但对于一个观点,我需要显示在横向模式下的内容..旋转视图以扩展内容

我尝试这样做:

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { 
return (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft); 
} 
+0

尝试过了,你是怎么得到?当'toInterfaceOrientation'为'UIInterfaceOrientationLandscapeLeft'或'UIInterfaceOrientationLandscapeRight'时,您必须在此方法中编写您的需求代码 – Rakesh

回答

0

用途:

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

在UIApplication.h定义其它宏:

UIDeviceOrientationIsValidInterfaceOrientation(orientation) 

UIInterfaceOrientationIsPortrait(orientation) 

UIInterfaceOrientationIsLandscape(orientation)