你的plist设置正确。
现在确保所有视图控制器都具有以下功能:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation
{
return (toInterfaceOrientation==UIInterfaceOrientationLandscapeRight) ? YES : NO;
}
没有它的儿童观会把事情搞得一团糟。
另外,如果你有一个UINavigationController或类似的,你需要对它进行子类化并实现shouldautrotatetointerfaceOrientation,因为它本身就非常愚蠢,而且会默认为肖像并破坏东西。
那么对于viewdidload
- (void)viewDidLoad {
[super viewDidLoad];
CGRect rect = [[UIScreen mainScreen] bounds];
rect.size.height = 320;
rect.size.width = 480;
rect.origin.x = 0;
rect.origin.y = 0;
glView = [[EAGLView alloc] initWithFrame:rect pixelFormat:GL_RGB565_OES depthFormat:GL_DEPTH_COMPONENT16_OES preserveBackbuffer:NO];
[self.view addSubview: glView];
[glView addSubview: minimapView];
//etc...
}