= I had this problem and tormented my hair for a long time, but in the end I got it to work perfectly in landscape mode, regardless of how the user holds the phone. This is a little strange, and if anyone knows better, please let me know!
1 - I have to have a representation (of the controller that calls the leaderboard) in the portrait, in my case, done in IB
2 - works only if you support portrait orientation (even if it looks like a landscape) -
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortrait); }
3 - Then you need to resize and rotate the leaderboard -
[self presentModalViewController: leaderboardController animated: YES]; leaderboardController.view.transform = CGAffineTransformMakeRotation(CC_DEGREES_TO_RADIANS(0.0f)); leaderboardController.view.bounds = CGRectMake(0, 0, 480, 320); leaderboardController.view.center = CGPointMake(240, 160);
4 - Hey presto! It works great. Hope this works for you too.
Somaman
source share