在我的iPhone应用程序中,我有以下代码来旋转视图相对于设备方向。
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return YES;
}
当设备旋转到横向模式时,视图不会旋转。
我试过了return (interfaceOrientation == UIDeviceOrientationLandscapeLeft);
它不起作用,我怎么能这样做?该类包含一个搜索栏,表格视图如
提前thanx
答案 0 :(得分:3)
I think the reason should be the below issue:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return YES;
}
"You should write return YES; in every viewController in your Application. Even in one class if you write return No; it will not work obviously..."