【发布时间】:2012-08-28 14:23:53
【问题描述】:
我不知道为什么设备方向不起作用。
在项目属性中:
在我的代码中:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return ((interfaceOrientation == UIInterfaceOrientationPortrait) ||
(interfaceOrientation == UIInterfaceOrientationLandscapeLeft) ||
(interfaceOrientation ==UIInterfaceOrientationLandscapeRight));
}
我在我的 iphone 中探测它并没有改变。
有什么遗漏吗?
提前谢谢你
已编辑(info.plist)
【问题讨论】:
-
在 info.plist 中添加支持的界面方向
-
您的设备是否启用了方向锁定?
-
不,它没有被锁定,我也试过用xcode中的iphone模拟器
-
您是否使用自定义初始化程序在代码中初始化视图控制器?您是否覆盖了
-initWithNibName:bundle:?您的视图控制器是嵌入在父视图控制器中的子视图控制器吗?
标签: iphone objective-c xcode4.3