2013-03-03 36 views
0

我想我的UITableViewController只是横向,但它甚至不会从肖像旋转... 我在我的项目设置中将方向属性设置为横向,并且我改变了StoryBoards中的UITableViewController方向,但仍然没有。我还应该怎么做? 在设备/模拟器上运行时,它被锁定在肖像左侧。为什么UITableViewController不能旋转?

http://img15.imageshack.us/img15/9652/tavblef.png

+0

在您的视图控制器中,应该有一个方法' - (BOOL) shouldAutoRotate',如果这是返回'NO'或'FALSE',那可能是问题。 – 2013-03-03 19:17:04

+0

你用什么ios版本? – edzio27 2013-03-03 19:21:06

+0

@Mike D:这是新项目,并且shouldAutoRotate具有默认值 - YES – Dawid 2013-03-03 19:23:14

回答

0

确保你有你的 “项目名称” 设置这四个方位支持 - > “目标” - > “信息”:

enter image description here

+0

看起来和你一样 – Dawid 2013-03-03 19:47:14

0

尝试添加这是您的viewcontroller.m文件

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
// Return YES for supported orientations 
return (interfaceOrientation== UIInterfaceOrientationLandscapeRight|| interfaceOrientation==  UIInterfaceOrientationLandscapeLeft); 
} 
+0

部署目标5.0 + iPad 5.01 - >不起作用 – Dawid 2013-03-03 20:36:40

0

所以答案很简单。 我在Storyboard中创建了一个新的项目和一个新的UITableViewController,但是我在默认的UIViewController类上工作,而不是创建UITableViewController的子类...

相关问题