Iphone 将项目从纵向转换为横向时出现问题

Iphone 将项目从纵向转换为横向时出现问题,iphone,objective-c,cocoa-touch,ipad,uiinterfaceorientation,Iphone,Objective C,Cocoa Touch,Ipad,Uiinterfaceorientation,我已经在纵向方向上开发了我的项目,现在我想在横向方向上设置我的项目方向。我已经将所有xib文件的方向属性设置为横向,并且在.plist中,我还将所有受支持的界面方向项设置为横向,但是当我运行我的项目时,一个视图仍然是纵向的。。。在这个视图中,我显示的是pdf文件 提前感谢 您是否在视图控制器中放置了以下方法 - (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation

我已经在纵向方向上开发了我的项目,现在我想在横向方向上设置我的项目方向。我已经将所有xib文件的方向属性设置为横向,并且在.plist中,我还将所有受支持的界面方向项设置为横向,但是当我运行我的项目时,一个视图仍然是纵向的。。。在这个视图中,我显示的是pdf文件


提前感谢

您是否在视图控制器中放置了以下方法

- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
    return YES;
}

如果使用此代码

(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
    return (interfaceOrientation==UIInterfaceOrientationLandscapeLeft || interfaceOrientation==UIInterfaceOrientationLandscapeRight);
}
(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
    return (interfaceOrientation==UIInterfaceOrientationPortrait || interfaceOrientation==UIInterfaceOrientationPortraitUpsideDown);
}
如果需要,请使用此代码

(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
    return (interfaceOrientation==UIInterfaceOrientationLandscapeLeft || interfaceOrientation==UIInterfaceOrientationLandscapeRight);
}
(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
    return (interfaceOrientation==UIInterfaceOrientationPortrait || interfaceOrientation==UIInterfaceOrientationPortraitUpsideDown);
}

当方向改变时,试着设置该元素的框架。你的意思是,如果方向是什么,所有的视图都应该改变为横向。我想你可能忘了放那个函数,哈哈,所以我回答了