0

我银行的应用程序设计得很好。纵向显示我帐户上的动作,如果 iPhone 处于横向模式(右侧或左侧),它会显示一个带有两个轴的图表。我怎么能做这样的事情?我的应用程序中有很多视图,我只需要纵向模式,但对于一个视图,我需要以横向模式显示内容..

我试过这个:

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

1 回答 1

0

利用:

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

UIApplication.h 中定义的其他宏:

UIDeviceOrientationIsValidInterfaceOrientation(orientation)

UIInterfaceOrientationIsPortrait(orientation)

UIInterfaceOrientationIsLandscape(orientation)
于 2013-07-02T14:15:50.633 回答