2011-03-04 54 views
3

我已经开发了我的纵向方向项目,现在我想在横向上设置我的项目方向。我已经将所有xib文件的方向属性设置为横向,并且在.plist中也将所有支持的界面方向的项目设置为横向,但是当我运行我的项目时,一个视图仍然以纵向取向...在此视图中, pdf文件。将我的项目从纵向转换为横向的问题

在此先感谢!

+0

尝试设置的,该框架元素的方向变化 –

+0

你的意思是所有的意见都应该改为兰斯卡提供任何可能的取向都是pe取向。 – SNR

回答

2

做你把下面的方法在您的视图控制器

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

非常感谢Kshitiz!实际上这个方法被评论了。 –

+0

我想可能是你忘记了这个功能,哈哈,所以我回答说 –

1

如果横向使用此代码

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

如果肖像使用此代码

(BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation { 
    return (interfaceOrientation==UIInterfaceOrientationPortrait || interfaceOrientation==UIInterfaceOrientationPortraitUpsideDown); 
} 
相关问题