当我的应用程序在横向模式下运行时(它总是这样),我的GameKit视图就会出现问题--如果我把手机放在纵向,GameKit视图就会出现在屏幕外,如果我把它放在横向视图模式下,它就会横着出现,比如,在横向模式下,但与呼叫视图控制器成90度角。几天来,我一直在努力寻找解决方案,唯一能起作用的(只要用户把手机保持在横向方向)是--
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}然后是-
leaderboardController.view.transform = CGAffineTransformMakeRotation(CC_DEGREES_TO_RADIANS(0.0f));
[leaderboardController.view setCenter:CGPointMake(240, 160)];问题是,如果用户以纵向方式握住手机,游戏中心将再次以90度角显示,处于其自身的纵向模式。帮助!任何睿智的话语都将不胜感激。
发布于 2011-02-22 14:50:59
嗯..。我也有同样的问题..但我是在用cocos2d制作我的游戏..不确定您当前使用的是什么引擎,或者是为了什么目的。
但是对于我的cocos2d..。这是我的代码..
mmvc.view.transform = CGAffineTransformMakeRotation( CC_DEGREES_TO_RADIANS( 90.0f ) );
mmvc.view.bounds = CGRectMake(0, 0, 480, 320);
[[UIApplication sharedApplication] setStatusBarOrientation: UIInterfaceOrientationLandscapeRight];https://stackoverflow.com/questions/5064629
复制相似问题