Reputation: 61
I followed this post's advice about forcing the orientation device to Portrait in Cocos2d.
However, this only changes in the Simulator. On an actual iPhone, the program is forced to and stays in Landscape mode. Any advice?
How do I force portrait mode in Cocos2D?
Upvotes: 0
Views: 372
Reputation: 479
Did you make sure you have this code in your app delegate?
// Supported orientations: Landscape. Customize it for your own needs
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}
Then also if you click the project icon, under the Supported orientations makes sure only portrait is selected.
Let me know if you have any problem.
Upvotes: 1